Post

Replies

Boosts

Views

Activity

NSFileProviderReplicatedExtension: uploading after completion handler
Hello, I'm implementing an NSFileProviderReplicatedExtension (iOS 26 and macOS 26) and would like to validate my approach. What I do To make my uploads efficient I batch them: instead of uploading file-by-file inside each createItem / modifyItem, I ingest all local changes into my extension's local state quickly and upload the content blobs in the background in batches. Concretely, for both createItem and modifyItem: I persist the item to my local store, write its content blob to a local cache, and schedule the upload in my internal queue. I call the completionHandler right away before uploading the item, returning the NSFileProviderItem with isUploaded = false. Once the upload succeeds, I flip the item to isUploaded = true and call signalEnumerator(for: .workingSet) so the change is delivered through the working-set enumerateChanges. This works in my testing, but I'm unsure it is the intended approach, and I have the following questions. Question 1 — Honoring the Progress object I call the completion handler early (step 2) and run the upload afterwards. The convenient part for my batched uploads is that I don't seem to need to honor the returned Progress at all — I never report into it and I just drop it, yet in my testing the upload still completes. I'd like to confirm two things: (a) Can I ignore the Progress? I'd like to never report into the returned Progress and simply drop it: I coalesce uploads into batches drained from a persisted queue, so I can't map one Progress to one upload, and retaining thousands of them is itself a cost. Is that allowed? What makes me unsure is that the docs read a little asymmetrically — for createItem the progress is "presented in the user interface until the completion handler is called", whereas for modifyItem it is "expected to include the upload progress … even if the provider chose to call the completion handler before the upload finishes". (b) If I ignore it, am I still granted execution time to finish the upload? This is what worries me, because the "Execution time" clause couples the two: the system "will grant enough time … to upload the file" but "will interrupt the call if it stops making progress." If I report no progress, does the system stop granting runtime? Question 2 — Upload pipeline depth When calling the completion handler before finishing the upload, both createItem and modifyItem are no longer gated by the NSExtensionFileProviderUploadPipelineDepth limit, and I can have thousands of items pending upload. This is crucial for my approach. Is this behaviour correct and intended?
1
0
385
Jun ’26
Scope and guarantees of currentSyncAnchor (NSFileProviderReplicatedExtension)
Should currentSyncAnchor(completionHandler:) return a global version number of the backend, or one scoped to the enumerator's container identifier? What should we return if the backend has no per-container version? Also, how does the system use this anchor? It appears to be followed by enumerateItems(for:startingAt:), but nothing seems to guarantee the anchor hasn't changed in between. Is there an atomicity expectation here?
3
0
287
Jun ’26
How to shrink the working set without serving stale content (NSFileProviderReplicatedExtension)
Enlarging the working set is straightforward — every item returned from enumerateItems(for:startingAt:) becomes part of it. But how do we safely remove items? If we exclude a folder from working-set change enumeration, the system shows the user an obsolete version of that folder, because it never calls enumerateItems(for:startingAt:) for it again. (Note: It seems system does call enumerateItems(for:startingAt:) again for materialized folders after extension restart.) What's the intended way to evict items from the working set?
1
0
184
Jun ’26
Is enumerateChanges the only mechanism for refreshing materialized folders? (NSFileProviderReplicatedExtension)
On a folder's first visit, the system materializes it via enumerateItems(for:startingAt:). Subsequent visits don't re-enumerate; freshness seems to rely on enumerateChanges(for:from:) on the working set. However, after an extension restart, visiting an already-materialized folder triggers enumerateItems(for:startingAt:) again — even though working-set changes were already consumed. So is enumerateChanges(for:from:) not the sole channel for keeping materialized items fresh? Under what conditions does the system re-enumerate a materialized folder?
1
0
172
Jun ’26
NSFileProviderReplicatedExtension: uploading after completion handler
Hello, I'm implementing an NSFileProviderReplicatedExtension (iOS 26 and macOS 26) and would like to validate my approach. What I do To make my uploads efficient I batch them: instead of uploading file-by-file inside each createItem / modifyItem, I ingest all local changes into my extension's local state quickly and upload the content blobs in the background in batches. Concretely, for both createItem and modifyItem: I persist the item to my local store, write its content blob to a local cache, and schedule the upload in my internal queue. I call the completionHandler right away before uploading the item, returning the NSFileProviderItem with isUploaded = false. Once the upload succeeds, I flip the item to isUploaded = true and call signalEnumerator(for: .workingSet) so the change is delivered through the working-set enumerateChanges. This works in my testing, but I'm unsure it is the intended approach, and I have the following questions. Question 1 — Honoring the Progress object I call the completion handler early (step 2) and run the upload afterwards. The convenient part for my batched uploads is that I don't seem to need to honor the returned Progress at all — I never report into it and I just drop it, yet in my testing the upload still completes. I'd like to confirm two things: (a) Can I ignore the Progress? I'd like to never report into the returned Progress and simply drop it: I coalesce uploads into batches drained from a persisted queue, so I can't map one Progress to one upload, and retaining thousands of them is itself a cost. Is that allowed? What makes me unsure is that the docs read a little asymmetrically — for createItem the progress is "presented in the user interface until the completion handler is called", whereas for modifyItem it is "expected to include the upload progress … even if the provider chose to call the completion handler before the upload finishes". (b) If I ignore it, am I still granted execution time to finish the upload? This is what worries me, because the "Execution time" clause couples the two: the system "will grant enough time … to upload the file" but "will interrupt the call if it stops making progress." If I report no progress, does the system stop granting runtime? Question 2 — Upload pipeline depth When calling the completion handler before finishing the upload, both createItem and modifyItem are no longer gated by the NSExtensionFileProviderUploadPipelineDepth limit, and I can have thousands of items pending upload. This is crucial for my approach. Is this behaviour correct and intended?
Replies
1
Boosts
0
Views
385
Activity
Jun ’26
Scope and guarantees of currentSyncAnchor (NSFileProviderReplicatedExtension)
Should currentSyncAnchor(completionHandler:) return a global version number of the backend, or one scoped to the enumerator's container identifier? What should we return if the backend has no per-container version? Also, how does the system use this anchor? It appears to be followed by enumerateItems(for:startingAt:), but nothing seems to guarantee the anchor hasn't changed in between. Is there an atomicity expectation here?
Replies
3
Boosts
0
Views
287
Activity
Jun ’26
How to shrink the working set without serving stale content (NSFileProviderReplicatedExtension)
Enlarging the working set is straightforward — every item returned from enumerateItems(for:startingAt:) becomes part of it. But how do we safely remove items? If we exclude a folder from working-set change enumeration, the system shows the user an obsolete version of that folder, because it never calls enumerateItems(for:startingAt:) for it again. (Note: It seems system does call enumerateItems(for:startingAt:) again for materialized folders after extension restart.) What's the intended way to evict items from the working set?
Replies
1
Boosts
0
Views
184
Activity
Jun ’26
Is enumerateChanges the only mechanism for refreshing materialized folders? (NSFileProviderReplicatedExtension)
On a folder's first visit, the system materializes it via enumerateItems(for:startingAt:). Subsequent visits don't re-enumerate; freshness seems to rely on enumerateChanges(for:from:) on the working set. However, after an extension restart, visiting an already-materialized folder triggers enumerateItems(for:startingAt:) again — even though working-set changes were already consumed. So is enumerateChanges(for:from:) not the sole channel for keeping materialized items fresh? Under what conditions does the system re-enumerate a materialized folder?
Replies
1
Boosts
0
Views
172
Activity
Jun ’26
Is enumerateChanges called only for the working set? (NSFileProviderReplicatedExtension)
In an NSFileProviderReplicatedExtension, is enumerateChanges(for:from:) ever called for enumerators other than .workingSet, or is it exclusively used for the working set?
Replies
1
Boosts
0
Views
195
Activity
Jun ’26