Skip to content

Conversation

@ihsanmokhlisse
Copy link

Summary

Fixes #9283 - macOS FileProvider/VFS folders with 1,500+ files not updating

Problem

Folders with many files (1,500+) would stop updating in Finder when using macOS FileProvider/VFS. The folder would sync correctly initially but eventually stop showing new files, even after forcing a VFS sync.

Root Cause

The bug was in Enumerator.swift where pagination was being disabled:

  1. pageSettings: nil - prevented pagination requests to the server
  2. nextPage = nil - unconditionally discarded pagination tokens from server responses

This caused only the first page of items (~50-100 files) to be enumerated, while all remaining files were never processed.

Solution

  • Enable pagination by passing proper pageSettings to readServerUrl()
  • Remove the unconditional nextPage = nil that was discarding pagination tokens
  • Pagination tokens from the server are now properly preserved and used for subsequent page requests

Testing

Added comprehensive unit tests following the existing testing strategy:

  • testLargeFolderChangeEnumerationWithPagination - Core bug fix verification
  • testLargeFolderItemEnumerationWithPagination - Item enumeration with pagination
  • testIncrementalLargeFolderUpdate - Simulates the exact bug scenario (phone scan uploads)
  • testVeryLargeFolderEnumerationWith150Items - Tests pagination across 3 pages
  • testVeryLargeFolderChangeEnumerationWith150Items - Change detection with many items
  • testLargeFolderChangeRecognised - Integration test with RemoteChangeObserver

Checklist

  • Follows Conventional Commits format
  • Signed-off-by line included (DCO)
  • Unit tests added
  • Code compiles without warnings
  • Follows existing code style

Fixes an issue where folders with 1,500+ files would stop updating in
Finder when using macOS FileProvider/VFS.

The bug was caused by pagination being disabled in the enumerateItems
method in Enumerator.swift:
- pageSettings was set to nil, preventing pagination requests to server
- nextPage was unconditionally set to nil, discarding pagination tokens

This caused only the first page of items (~50-100 files) to be detected
during enumeration, while remaining files were never processed.

Changes:
- Enable pagination by passing proper pageSettings to readServerUrl()
- Remove unconditional nextPage = nil that was discarding pagination
- Add unit tests for large folder enumeration with pagination
- Add integration test for RemoteChangeObserver with large folders

Closes nextcloud#9283

Signed-off-by: Dev Admin <[email protected]>
@Rello
Copy link
Collaborator

Rello commented Jan 5, 2026

Hello,

please do not proceed for the moment.
Pagination is already available but it had to be disabled due to a bug in the webdav implementation of this feature on the Nextcloud side. (second page did deliver wrong attributes)

I will search for the reference if it was fixed already...

@Rello
Copy link
Collaborator

Rello commented Jan 6, 2026

@Rello
Copy link
Collaborator

Rello commented Jan 6, 2026

the backend fix was merged. we will look into it

nextcloud/server#53674

@Rello Rello added this to the 4.1.0 milestone Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: macOS FileProvider/VFS - Folders with many files (1,500+) not updating

2 participants