Repository navigation
Backups: never prune a file's original backup before anything else - #534
Draft
raiseCatError wants to merge 1 commit into
Draft
raiseCatError wants to merge 1 commit into
raiseCatError wants to merge 1 commit into
Conversation
Pruning (oldest first above 200 entries) kept only recent protected entries and the newest entry per source/path. A burst of automatic writes (cursor shaders: 16 in 75 s on a real session) could push out the first backup of the terminal's main config, the only copy of what it was before NMSh. The oldest entry of every file path is now pruned only as a last resort, after every unprotected entry.
This branch has not been deployed
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.
Stacked on #533.
Bug (found in headless acceptance QA of
/changes; reproiso/retention.mjs): above 200 entries, the journal prunes oldest first. It kept only the newest 20 reset/restore/manual entries and the newest entry per (source, path). So twoappearanceedits ofkitty.conffollowed by 260 automatic cursor-shader writes pruned the firstkitty.confbackup, the only copy of the user's config from before NMSh touched it. On the maintainer's real machine NMSh wrote 16 cursor-shader backups in about 75 s, so 200 entries is roughly 15 minutes of such activity.Fix (
src/backups/journal.ts): the oldest entry of every file path is pruned only as a last resort, after every unprotected entry has gone. Existing guarantees are unchanged, including the tiny-cap case in "the newest source/path anchor is retained…".Tests
tests/backupsJournal.test.ts"a burst of automatic writes to another file never prunes the original backup…". It fails without the fix and passes with it.tscis clean.Other findings from the same QA, not fixed here (follow-ups):
theme-bridge/ledger.jsonis rewritten on every launch without a backup, so most entries show "edited since". Restoring an older entry reverts the ledger and drops vim ownership./changesnames neither the entry nor the cause.preparedby a killed write is not flagged as interrupted.updateModeto automatic.