Repository navigation
fix: keep every set-aside preferences file, leave unreadable ones in place, and mute unselected Preferences categories - #15
Merged
Conversation
… temporary file A second invalid preferences file now goes to preferences.json.invalid.1 (then .2, ...) instead of replacing the first copy, and the status line names the file. Only a file that is not valid preferences is set aside: one that cannot be read at all (a permission error, a directory) stays where it is and nothing is saved this session. The temporary file carries the process id, so two Collectors saving at once no longer write into the same file.
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.
Follow-up to #13, from its review.
preferences.jsongoes topreferences.json.invalid.1(then.2, ...), and the status line names the file it used. Before,fs::renamesilently replaced the first.invalidcopy.loadnow reports a parse failure asInvalidData; any other read error (permission denied, a directory in place of the file) leaves the file where it is and turns saving off for the session, with the error on the status line.savewrites throughpreferences.json.<pid>.tmp, so two Collectors saving at the same moment cannot truncate each other's temporary file and rename a partial one into place.text_muted; hovered ones getbg_card_hover; the selected one keeps the accent fill withon_accenttext.Tests: a second invalid file lands in
.invalid.1with the first untouched; an unreadable path (a directory) is neither moved nor saved over; the round-trip test checks the per-process temporary file is gone.