Fix mirror restore deletion semantics - #20
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.
User-facing behaviour
Only newrestores only files that are absent locally or newer in the selected backup.Allrestores every selected file without deleting local files.All and delete extrarestores every selected file, then deletes local files represented by the selected deletion records.Restore and Delete Confirmationand the explicit actionRestore and delete;Cancelremains the default action.Implementation summary
Root cause
The restore view mapped the UI modes incorrectly, and restore execution used the current top-level missing state rather than the state of the selected historical revision. Extraction failures could also be reported as success, allowing deletion to proceed without a complete restore. The legacy folder workflow attempted to extract contentless deletion records.
Behaviour and responsibility boundary
‘All and delete extra’ now restores every selected archive entry successfully before it removes the confirmed deletion candidates. The confirmation dialogue presents a point-in-time restore plan; it does not lock the Vault or revalidate candidates changed while the dialogue is open. If the Vault may have changed during review, the operation must be cancelled and prepared again.
Validation
npm run buildnpm run check:e2e:obsidiannpm run lintnpm run test:ui— 11 passeddeno task test— 68 passednpm run test:e2e:obsidian:legacy-folder-restorenpm run test:e2e:obsidian:restore-confirmationnpm run test:e2e:obsidian:wake-locknpm run test:e2e:obsidian:mirror-delete-semanticsThe mirror E2E covers historical deletion and recreation decisions, extraction failures, write failures, wake-lock lifetimes, and a 24-file deletion plan. The legacy E2E restores an ordinary revision from a real ZIP while skipping a deletion record.