Repository navigation
Conversation
Paginated PROPFIND/SEARCH responses carry X-NC-Paginate-Token only with the first page; follow-up pages are served from the server's pagination cache with only X-NC-Paginate: true. The File Provider enumerator and the media metadata backfill overwrote the token with each response, so it became nil after the first cached page and the server rebuilt the full listing on every second request. - Keep the previous token when a paginated response has none. - Reset token, total and page counts when the File Provider listing restarts at page 0, so it never continues an earlier cached result. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Jeldrik Schröer <jeldrik@jschroeer.de>
jeldriks
force-pushed
the
fix/keep-pagination-token
branch
from
November 21, 2026 16:52
708496c to
c9ba6bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Keep the WebDAV pagination token across all pages of a paginated listing.
Nextcloud's paginated PROPFIND/SEARCH returns
X-NC-Paginate-TokenandX-NC-Paginate-Totalonly with the first page. Follow-up pages are served from the server's pagination cache and carry onlyX-NC-Paginate: true; clients are expected to keep the token (NC 31 developer notes, nextcloud/server#10880).Two places overwrote the token with each response, so it became
nilafter the first cached page. The next request then went without a token, and the server built and cached the full listing again under a new token:Changes
FileProviderEnumerator: keep the previous token when a response has none. When a listing restarts at page 0, reset the token, total and page counts, so it never continues from an earlier listing's cached result or offsets.NCMediaMetadataBackfillProcessor: keep the previous token when a response has none. The token is local to one batch, so it is never reused across searches.NCMediaNetworkalready handled this correctly and is unchanged.How to verify
X-NC-Paginate-*request headers), every follow-up request of the listing should carry the same token and come back quickly. Before this change, every second request has no token and takes as long as the first.Tested
Live test against a Nextcloud 35.0.3 server (iOS 27.2 simulator, debug build with 50 entries per page), listing a folder with 7,469 files in the Files app:
File Provider ExtensionandNextcloudschemes build; SwiftLint reports no new findings.No unit tests:
FileProviderEnumeratorbelongs to the extension target, whichNextcloudUnitTestscannot import, and the backfill change is a single??fallback. I can extract the paging state into a testable type if you prefer.🤖 AI (if applicable)
Investigation, code and this description were drafted with Claude Code (claude-opus-5-5) and reviewed by me.