Settings persistence: atomic store (fixes power-loss corruption), clamps, and safe reads - #70
Merged
Merged
Conversation
The atomic tauri-plugin-store fork (pinned in [patch.crates-io]) needs its git source in deny.toml's sources.allow-git, same as the existing rodio/tauri/vad-rs forks. Closes the check:rust-dependency-policy gate for Phase 5. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…ivacy-safe fallback Phase 5's read-only get_settings path flagged New (clean-install) reads with a 'deferred to startup' persistence_error, and settings_for_non_command_read fail-closed on it -> history/recordings OFF on every fresh install. Early get_settings reads run before the startup loader persists, so the packaged first-launch smoke (a pre-existing shipped contract) saw retention disabled. A clean first-run default is safe to report on a read: defaults are history/ recordings ON and the startup loader persists them moments later. Fail-closed is retained for Recovered (unparseable user data, unknown intent) and for a REAL persist failure (load_settings_from_store path; those tests unchanged). Reproduced + verified with a clean-profile run of scripts/native-smoke; added a regression test asserting a clean-store read reports default retention. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…binding The two registration-failure tests hardcoded ctrl+space / ctrl+shift+space and failed on macOS where the default binding is Cmd-based. Derive the expected detail from the binding under test so the assertion is platform-correct. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 12, 2026
Merged
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.
Before Submitting This PR
Please confirm you have done the following:
Human Written Description
The settings file kept getting corrupted — a couple of times after a hard shutdown the app came up with everything reset, because the store plugin writes settings with a plain truncate-and-overwrite and a power loss mid-write leaves a half-written (or zero-byte) file. That's the same class of bug people have reported upstream. I also wanted the privacy-sensitive toggles (history off, recordings off) to actually be on disk the instant you flip them, not whenever a debounce timer happens to fire. So this makes settings writes atomic and durable, and tightens up a few settings that could be set to nonsense values.
Related Issues/Discussions
Bug-fix work (top priority per CONTRIBUTING). Fixes settings-file corruption on power loss (same root cause as tauri-apps/plugins-workspace#3085) and hardens the settings/persistence layer.
Fixes #
Discussion:
Testing
TDD throughout; full Rust library suite passes 688/688. Key coverage:
cargo deny(advisories/bans/licenses/sources) passes with the fork source allow-listed.Screenshots/Videos (if applicable)
N/A (backend/persistence changes).
AI Assistance
If AI was used:
What's in this PR
tauri-plugin-storeis pinned to a small fork whosesave()writes to a same-directory temp file,fsyncs, then atomically renames — so a crash or power loss can never leave a corrupt/zero-byte settings file. Privacy-critical writes (history/recordings/credentials, reset paths) now flush through this atomic path explicitly instead of relying on the debounced autosave.Stacks on the reliability train (#69, already merged).
🤖 Generated with Claude Code