Skip to content

A corrupt audio-settings.json is silently replaced with defaults at shutdown #45

Description

@ErwanLegrand

What happens

An audio-settings.json that failed to parse is silently replaced with defaults when the
application exits. Observed on the reference machine during FR-UI-070's manual run (2026-08-27),
step 9: garbage was written into the file, the app started on defaults with the expected
app.settings.unreadable warning, and after shutdown the file held a valid default document.

Cause

crates/namir-app/src/app.rs:486 unconditionally persists the negotiated settings on exit, which is
FR-IO-080's intent — "persist whatever was actually negotiated … so the next launch starts from what
worked this time". Applied to a file the user may have been in the middle of hand-editing, it
destroys the edit.

The notice says "using defaults". It does not say the file will be overwritten.

Why it is worth a decision rather than a shrug

FR-STATE-040 makes hand-editability an explicit goal for the state document; a settings file with a
typo is the ordinary way a user discovers they got the syntax wrong, and today they lose the file
rather than getting a chance to fix it. That shutdown save is also the one report in the program that
cannot become a notice, by design, because the window is already closed
(crates/namir-app/src/app.rs:481) — so if it fails, nothing on screen ever says so.

Options

  • Keep a .bak of an unreadable settings file before the first overwrite.
  • Or skip the shutdown save when the load failed, until the user changes something.
  • Or say so in the notice, so at least the behaviour is announced.

Evidence

docs/manual-tests/fr-ui-070-non-modal-error-notices.md, executed run, "Observations outside
FR-UI-070's own clauses".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions