Skip to content

fix(file-provider): propagate directory metadata write failures - #11180

Open
Rello wants to merge 1 commit into
masterfrom
codex/file-provider-discovery-db-errors
Open

Rello wants to merge 1 commit into
masterfrom
codex/file-provider-discovery-db-errors

Conversation

@Rello

@Rello Rello commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

For example, the client knows Documents/report.txt with ETag v1. Someone edits the file on the server, changing its ETag to v2. The client reads the Documents folder and receives v2, but saving that information in the local database fails. Its stored ETag therefore remains v1.

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

  • Run the new EnumeratorPersistenceTests suite and relevant existing enumeration tests.
  • Build the affected target.
  • Complete contributor review before marking ready.

Checklist

  • Sign-off and AI-assistance trailers included.
  • Conventional commit; one focused commit based on master.
  • Regression tests included.
  • No user-facing documentation change required.

AI

  • Implementation and regression tests were prepared with Codex under the contributor's direction.

Assisted-by: Codex:GPT-5

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
Rello marked this pull request as ready for review October 30, 2026 13:28
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant