Summary
All config migration functions (v003 through v009) currently use plain fs::write to persist updated config.toml files. If a write is interrupted mid-migration (process kill, power loss, disk full), the config can be left truncated or partially written, causing a broken launch on the next run.
An atomic_write helper already exists at src/session/storage.rs:35. A cross-migration sweep should replace every fs::write(path, content) call in the src/migrations/ directory with the atomic equivalent (write to a temp file alongside the target, then rename into place).
Context
Raised during review of #1386 (comment: #1386 (comment)). The v009 migration intentionally kept fs::write for consistency with the existing migrations; this issue tracks the follow-up sweep.
Acceptance criteria
/cc @Seluj78
Summary
All config migration functions (v003 through v009) currently use plain
fs::writeto persist updatedconfig.tomlfiles. If a write is interrupted mid-migration (process kill, power loss, disk full), the config can be left truncated or partially written, causing a broken launch on the next run.An
atomic_writehelper already exists atsrc/session/storage.rs:35. A cross-migration sweep should replace everyfs::write(path, content)call in thesrc/migrations/directory with the atomic equivalent (write to a temp file alongside the target, then rename into place).Context
Raised during review of #1386 (comment: #1386 (comment)). The v009 migration intentionally kept
fs::writefor consistency with the existing migrations; this issue tracks the follow-up sweep.Acceptance criteria
src/migrations/(v003 through v009, and any future migrations) use atomic writes when updating config files./cc @Seluj78