Repository navigation
Sync → Refuse a first sync that would orphan remote files - #130
Merged
Merged
Conversation
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.
Resolves #109
Problem
listObjectsexisted on the storage client but sync never consulted itChanges
geode-sync-testbucket with a full wipe between scenarios, since the first sync check lists the whole bucketWhy
Greptile Summary
This PR closes the silent-orphan hole introduced when a manifest is deleted while bucket objects survive: a first sync now lists the bucket and refuses the pass when any object has no local counterpart, naming each stranded key. Objects that do match local files still proceed, so an interrupted first sync (files pushed, manifest never landed) heals correctly on retry.
orphanedKeysinsync.tsdrives the new guard;syncOncecalls it only on first-sync paths, and a failed listing refuses rather than proceeding.fakeStorage.listObjectsis fixed to reflect the in-memory store instead of always returning empty, making the three new unit tests meaningful.geode-sync-testbucket with a full wipe between scenarios, since the whole-bucket listing would trip the orphan refusal if leftover objects from other test files were present.Confidence Score: 5/5
The change is additive and conservative: it only adds a refusal on the first-sync code path that previously had no listing call, and every new failure path returns early without touching the bucket.
The orphan detection logic is correct, all new failure modes return without side effects, the fakeStorage fix makes the unit tests genuinely exercise the new path, and the integration test isolation strategy is sound. No pre-existing behaviour on non-first-sync paths is touched.
No files require special attention.
Important Files Changed
Reviews (2): Last reviewed commit: "Address comment" | Re-trigger Greptile