-
Notifications
You must be signed in to change notification settings - Fork 917
feat: re-enable WebDAV pagination for large folder enumeration on macOS #9442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This currently does not build yet and is blocked due to lack of server version exposure through NextcloudCapabilitiesKit which already is in the making: |
0d5eeba to
d99b21b
Compare
|
Enumerating a server (Nextcloud Docker container on localhost) directory with 10000 items takes more than 2 minutes in my case. The insertion of metadata into the client database could be accelerated significantly by using batch operations, it appears to be the current bottleneck. Any investment in the current database implementation is potentially a waste, though (see #9046). In general, this works fine. |
d99b21b to
5262e89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR re-enables WebDAV pagination for large folder enumeration in the macOS File Provider extension. Pagination was previously disabled due to a server-side bug that has since been fixed and backported to Nextcloud 31+. The implementation adds version gating to conditionally enable pagination only for servers running Nextcloud 31 or newer, ensuring backward compatibility with older servers.
Changes:
- Core implementation in
Enumerator.swiftadds server version detection and conditional pagination enablement - Comprehensive test suite with 226 lines of tests verifying pagination behavior for NC31+ and fallback for older servers
- Dependency update to NextcloudCapabilitiesKit 2.4.6 (from 2.4.5)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved |
Updates NextcloudCapabilitiesKit dependency from 2.4.5 to 2.4.6 |
shell_integration/MacOSX/NextcloudFileProviderKit/Tests/NextcloudFileProviderKitTests/EnumeratorTests.swift |
Adds three comprehensive tests for pagination: NC31+ enablement, NC30 fallback, and large folder handling with 50+ items |
shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Enumeration/Enumerator.swift |
Implements server version detection, conditional pagination enablement, removes unconditional pagination disabling, and increases default page size from 100 to 1000 |
shell_integration/MacOSX/NextcloudFileProviderKit/Package.swift |
Bumps minimum macOS version from 11 to 12 |
AGENTS.md |
Adds clarification that iOS and Android platforms are irrelevant for this desktop client project |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...acOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Enumeration/Enumerator.swift
Show resolved
Hide resolved
...acOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Enumeration/Enumerator.swift
Show resolved
Hide resolved
...acOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Enumeration/Enumerator.swift
Show resolved
Hide resolved
- Pagination was fixed for Nextcloud server 31 and newer. - The client now dispatches paginated requests when connected to Nextcloud 31 or newer. - Added tests. - Updated to NextcloudCapabilitiesKit 2.4.6 which now exposes server version information which is required for the Nextcloud 31 and newer detection. - Increased pagination size from 100 to 1000 because it barely makes a difference in memory usage on unlimited macOS.
Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
…S to 12. We do not support macOS before 12 anymore, anyway. This enables newer APIs. Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
5262e89 to
1a17e11
Compare
|
Artifact containing the AppImage: nextcloud-appimage-pr-9442.zip Digest: 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. |
|



Description
Pagination for WebDAV PROPFIND requests was disabled due to a server-side bug that caused incorrect results. This led to timeouts and memory exhaustion when enumerating folders with 1000+ files, as all items were fetched in a single request.
The server bug was fixed and backported to Nextcloud 31+. This change re-enables pagination with version gating to ensure compatibility.
Changes
Core Implementation (
Enumerator.swift, 30 lines)pageSettings) only forserverVersion >= 31pageIndexand pagination token fromNSFileProviderPagenextPage = nilthat disabled paginationTests (
EnumeratorTests.swift, 226 lines)Technical Details
The implementation leverages existing pagination infrastructure:
EnumeratorPageResponseparsesx-nc-paginate*headers from serverreadServerUrlhandles paginated requests whenpageSettings != nilBefore:
After:
Scope
Changes are isolated to macOS File Provider (
NextcloudFileProviderKit). Desktop sync client C++ code (LsColJob) does not currently support pagination and is out of scope.Signed-off-by: GitHub Copilot noreply@github.com
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.