Menu ▾ ▴

#120 Atomic settings writes; warn instead of silently resetting on corrupt settings.json

closed
nobody
2026-07-18
2026-07-17
Anonymous
No

Originally created by: kristofferR

save_settings (src-tauri/src/settings.rs) truncates-and-writes settings.json in place, and both load paths end in .unwrap_or_default(). A crash or full disk mid-write leaves a partial file, and the next launch silently resets every setting (theme, tray, hotkey, privacy toggles, zoom) with no warning. Fix: write to a temp file + fs::rename, and log a warning when a present-but-unparseable settings file is discarded.

Related

Tickets: #135
Tickets: #137

Discussion

  • Anonymous

    Anonymous - 2026-07-18

    Originally posted by: kristofferR

    Fixed in [#137]. Settings are written atomically (temp file + fsync + atomic rename, with ordered publish and stale-write rejection), and a corrupt settings.json now logs a warning and falls back to defaults instead of silently resetting.

     

    Related

    Tickets: #137

  • Anonymous

    Anonymous - 2026-07-18

    Ticket changed by: kristofferR

    • status: open --> closed
     

Log in to post a comment.