Skip to content

Skip Redundant Metadata Writes on Paginated Ingestion - #10811

Open
juliusvaart wants to merge 1 commit into
nextcloud:masterfrom
juliusvaart:macos/vf/skip-redundant-writes
Open

juliusvaart wants to merge 1 commit into
nextcloud:masterfrom
juliusvaart:macos/vf/skip-redundant-writes

Conversation

@juliusvaart

Copy link
Copy Markdown
Contributor

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 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 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.

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.

Tests

Full package suite green, 373 XCTest (1 skipped) and 78 swift-testing.

Assisted-by: Claude Code:claude-opus-5

Checklist

AI (if applicable)

…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
juliusvaart force-pushed the macos/vf/skip-redundant-writes branch from e12282c to 5fdfa05 Compare September 14, 2026 11:40
@i2h3 i2h3 added os: 🍎 macOS Apple macOS, formerly also known as OS X feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. labels Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. os: 🍎 macOS Apple macOS, formerly also known as OS X

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants