Skip Redundant Metadata Writes on Paginated Ingestion - #10811
Open
juliusvaart wants to merge 1 commit into
Open
juliusvaart wants to merge 1 commit into
juliusvaart wants to merge 1 commit into
Conversation
juliusvaart
requested review from
camilasan,
claucambra,
i2h3,
mgallien and
nilsding
as code owners
September 11, 2026 14:51
16 tasks
…stion The non-paginated ingestion path guards its writes with `isInSameDatabaseStoreableRemoteState`; the paginated one, which every enumeration takes on servers from Nextcloud 31, wrote every row of every listing unconditionally — one transaction and one `evictLogicalDuplicates` query each. One working-set scan rewrote 1,998 rows to surface 7 actual changes, against 5,858 evaluations that found no difference. Applying the same guard suppressed 99.7% of writes on the next run: 11 written, 3,655 skipped. `visitedDirectory` is compared explicitly because it is local-only and so absent from the remote-state comparison: a caller passing `preserveVisitedDirectory: false` is recording a visit and must always be written, or folders would fall out of the working set. Signed-off-by: Julius van der Vaart <julius@vanderva.art> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Assisted-by: Claude Code:claude-opus-5
juliusvaart
force-pushed
the
macos/vf/skip-redundant-writes
branch
from
September 14, 2026 11:40
e12282c to
5fdfa05
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
The non-paginated ingestion path guards its writes with
isInSameDatabaseStoreableRemoteState. The paginated one — which every enumeration takes on servers from Nextcloud 31 — wrote every row of every listing unconditionally, one transaction and oneevictLogicalDuplicatesquery each. One working set scan rewrote 1,998 rows to surface 7 actual changes, against 5,858 evaluations that found no difference at all.Applying the same guard to the paginated path suppressed 99.7% of the writes on the next run: 11 written, 3,655 skipped.
visitedDirectoryis compared explicitly because it is local-only and so absent from the remote-state comparison. A caller passingpreserveVisitedDirectory: falseis recording a visit and must always be written, or folders would fall out of the working set.Tests
Full package suite green, 373 XCTest (1 skipped) and 78 swift-testing.
Assisted-by: Claude Code:claude-opus-5
Checklist
AI (if applicable)