Repository navigation
Conversation
Return a local persistence error when a non-paginated depth-one read cannot save its metadata, allowing discovery to retain its sync anchor. Add regression coverage for failure, retry, and successful empty changes. Signed-off-by: Rello <github@scherello.de> Assisted-by: Codex:GPT-5
Rello
marked this pull request as ready for review
October 30, 2026 13:28
|
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
For example, the client knows
Documents/report.txtwith ETagv1. Someone edits the file on the server, changing its ETag tov2. The client reads the Documents folder and receivesv2, but saving that information in the local database fails. Its stored ETag therefore remainsv1.Currently, the failed database update returns no list of changes. The scanner treats that as “nothing changed” and can mark the scan as complete, even though it failed to record the new version.
This PR makes the failed save return an error instead. The scanner marks the scan as incomplete and keeps its previous sync progress point. A failed save is no longer mistaken for a successful check with no changes.
Found while investigating #11152. This fixes database-error reporting; the separate work on ETag-based folder skipping and recovery is not included.
Validation
Added six Swift Testing regression cases covering injected database write failures, unchanged stored metadata after failure, working-set anchor retention and retry, container error reporting, successful empty/nonempty change sets, and preservation of server errors. The tests use SQLite triggers to reject metadata writes while keeping reads and change-delivery storage available.
git diff --checkpassed. Tests and builds have not been run, at the contributor's explicit request. This remains a draft pending execution and human review; no passing test results are claimed.TODO
EnumeratorPersistenceTestssuite and relevant existing enumeration tests.Checklist
AI
Assisted-by: Codex:GPT-5