Summary
src-tauri/src/storage.rs:135 overwrites project.json directly with fs::write(...).
src-tauri/src/storage.rs:152 already contains corrupt-entry recovery because malformed project.json files are expected in the wild.
A crash or forced quit during save can leave truncated JSON on disk and make a project disappear behind the corrupt-entry path on the next load. Remediation: write to a temp file in the same directory, flush/fsync it, and rename it into place atomically so readers see either the old or new valid document, never a torn file.
Maintainer Metadata
- Fingerprint:
atomic|corruption|data|filesystem|integrity|json|metadata|storage|write
- Symptom Type:
metadata corruption
- Affected Files: src-tauri/src/storage.rs
- Keywords: storage, project_json, atomic_write, data_integrity, filesystem
Summary
src-tauri/src/storage.rs:135overwritesproject.jsondirectly withfs::write(...).src-tauri/src/storage.rs:152already contains corrupt-entry recovery because malformedproject.jsonfiles are expected in the wild.A crash or forced quit during save can leave truncated JSON on disk and make a project disappear behind the corrupt-entry path on the next load. Remediation: write to a temp file in the same directory, flush/fsync it, and rename it into place atomically so readers see either the old or new valid document, never a torn file.
Maintainer Metadata
atomic|corruption|data|filesystem|integrity|json|metadata|storage|writemetadata corruption