Skip to content

fix(file-provider): Correctly enumerate large change batches - #10660

Merged
claucambra merged 6 commits into
masterfrom
work/fp/anchor-continuation
Aug 25, 2026
Merged

fix(file-provider): Correctly enumerate large change batches#10660
claucambra merged 6 commits into
masterfrom
work/fp/anchor-continuation

Conversation

@claucambra

@claucambra claucambra commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Resolves

#10556

Summary

We had issues with the batched change reporting in the enumerator.

  1. We needed to change the anchor in between change batches in order for moreComing to be respected by the system (and for further changes to be requested by the system)
  2. These intermediate anchors need to survive outside of the enumerator instance used for the initial change enumeration, as the system creates a new enumerator per batch

Issue Reproduction

The unchanged-anchor bug reproduced successfully.

  • Baseline folder was empty and visited.
  • With client and extension stopped, 205 files were uploaded successfully.
  • After restart, the extension derived 207 updates: 205 files plus the root and test folder.
  • It reported 200 updates, retained seven, and returned moreComing: true.
  • Subsequent scans restarted from the identical anchor instead of delivering the seven-item continuation.
  • Finder’s File Provider mount contained only 198 of the 205 files. The missing files were item-122.txt through item-127.txt, plus item-191.txt.
  • All seven missing files returned HTTP 200 from the server.
  • No 502 occurred, and there were zero File Provider errors before cleanup.

The current macOS version did not retain the literal “token is unchanged” message, but the daemon’s anchor remained unchanged and no updated: 7, moreComing: false batch occurred. The behavior is therefore confirmed directly.

Checklist

AI (if applicable)

@claucambra claucambra added this to the 34.0.3 milestone Aug 25, 2026
@claucambra claucambra self-assigned this Aug 25, 2026
@claucambra claucambra added os: 🍎 macOS Apple macOS, formerly also known as OS X feature: 💽 virtual filesystem feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. labels Aug 25, 2026
@claucambra
claucambra force-pushed the work/fp/anchor-continuation branch from 5d239c7 to 9e6e9aa Compare August 25, 2026 07:15
@Rello

Rello commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

tested on my side

  • 205 server files were discovered as 207 updates.
  • First batch: 200, moreComing: true.
  • macOS created a fresh Enumerator using fp-continuation|…|200.
  • Final batch: 7, moreComing: false.
  • Finder contained all 205 files: 0 missing, 0 extra.
  • A subsequent server file also appeared, proving later changes still propagate.
  • No 502 responses, incomplete scans, or errors occurred before cleanup.

@claucambra

Copy link
Copy Markdown
Collaborator Author

/backport to stable-34.0 please

final sync anchor instead of a continuation anchor.

The framework may invalidate the current `Enumerator` after an intermediate
batch and create another one for the next request. The extension process may

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh… The framework always is good for surprises like these. The best part: it can change any time. 🙄

/// A thread-safe FIFO buffer of change metadata still to be delivered to an
/// `NSFileProviderChangeObserver` across the successive `enumerateChanges(for:from:)` invocations the
/// framework drives with `moreComing: true`.
/// Durable FIFO state for a multi-batch File Provider change enumeration.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit odd wording, I would have used the conventional "persistent" because "durable" sounds more like bicycle tires. 😅 Not an issue, though.

@github-actions

Copy link
Copy Markdown
Contributor

Artifact containing the AppImage: nextcloud-appimage-pr-10660.zip

Digest: sha256:9f97f2a84f705d527495203d47c7402a6125f6999ab34e4ac881424dbdebe8ad

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.

@i2h3 i2h3 moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 💻 Desktop Clients team Aug 25, 2026
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 💻 Desktop Clients team Aug 25, 2026
@i2h3 i2h3 added the bug label Aug 25, 2026
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
…ivery types

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
…re used during change enumeration

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
…on completed

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
@Rello
Rello force-pushed the work/fp/anchor-continuation branch from 0b1e7e8 to 95d1d20 Compare August 25, 2026 13:13
@mgallien
mgallien enabled auto-merge August 25, 2026 13:41
@claucambra
claucambra disabled auto-merge August 25, 2026 14:17
@claucambra
claucambra merged commit be88433 into master Aug 25, 2026
21 of 22 checks passed
@claucambra
claucambra deleted the work/fp/anchor-continuation branch August 25, 2026 14:17
@github-project-automation github-project-automation Bot moved this from 🏗️ In progress to ☑️ Done in 💻 Desktop Clients team Aug 25, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. feature: 💽 virtual filesystem os: 🍎 macOS Apple macOS, formerly also known as OS X

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

4 participants