Repository navigation
Version settings.json and voices.json, and set unreadable or newer files aside (D-61) - #61
Merged
Merged
Conversation
…les aside (D-61)
settings.json had a version nothing read: when it failed to parse, the app
saved first-run settings over it and the user's profiles were lost.
voices.json was a bare list with no version: when it failed to parse, the
next new voice overwrote the list.
- stored.rs: shared loader. Reads the format version, upgrades an older file
one step at a time with the file's migrate, moves an unreadable file to
<name>.broken-<secs> and copies a newer one to <name>.v<N>-<secs> before
going on, and returns a notice for the user.
- settings.json: SETTINGS_VERSION, migrate, and extra members kept.
- voices.json: now {version, voices}; the bare list reads as v0. Voices
keep unknown members too.
- .vsproj: a migrate step on load beside the existing TooNew check.
- take_startup_notices: the UI shows the notices at start.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
stored.rs(new): shared loader for the app's own JSON files. It reads the format version and upgrades an older file one step at a time with that file'smigrate.<name>.broken-<unix secs>before the app goes on with defaults.<name>.v<N>-<unix secs>(once) and read as far as this build understands it.settings.json:SETTINGS_VERSION = 1, amigratehook, and#[serde(flatten)] extra, so members a newer version added survive a save.voices.json: now{"version": 1, "voices": [...]}. The old bare list reads as v0 and is upgraded on the next save. EachVoicekeeps unknown members too..vsproj: amigratestep on load, beside the existingTooNewrefusal.take_startup_noticescommand: the UI shows what loading found (the path of a file set aside) as an error notice at start.architecture.mdandCLAUDE.md.Why
settings.jsonhad aversionthat nothing read. When it failed to parse (a damaged file, or a future breaking change),lib.rssaved first-run settings over it, and the user's profiles were lost silently.voices.jsonhad no version. When it failed to parse, the library opened empty and the next new voice overwrote the list.Notes for review
migratestep, only when a change would read an older file wrongly..v<N>-…copy keeps the original. See D-61 for the alternatives.catalog.json(the override) is not covered: it already falls back to the bundled catalog, and nothing writes to it.npm run check, including new unit tests instored.rs,settings.rsandvoices.rs. I did not see the startup notice in the running app.🤖 Generated with Claude Code