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?
Hello,
Normally, enumerateItems on a folder will only be called when the folder is initially materialized, and might be called a second time soon after that materialization. And enumerateChanges is the main source for keeping the system updated with changes happening remotely.
If the workingSet anchor expires (enumerateChanges fails with syncAnchorExpired), the system might be forced to reevaluate the content of all the folders.
If you notice folders are being reenumerated more often than expected, don't hesitate to file a Feedback with a sysdiagnose captured soon after reproducing the issue.