Problem
Two snapshots of the same project and trigger type created within one second use the same backing filename. Their metadata rows have distinct IDs, but the second write overwrites the first file. Deleting either snapshot then removes the file used by the other.
Reproduction
- Open a disposable project.
- Call
create_snapshot twice in rapid succession, with different names and trigger_type: "manual" (the same collision also applies to repeated export-triggered snapshots).
- Compare the returned metadata: the IDs differ but
file_path matches.
- Delete the first snapshot, then preview or restore the second.
Expected: independent backing files; removing one snapshot leaves the other restorable.
Actual: preview/restore of the surviving entry fails because its shared file has been deleted. If prose changes between creation calls, the earlier entry also restores the later content.
Evidence
Reproduced through the running Tauri app during #242 validation using a disposable imported project:
- Snapshot A created at
2026-09-07T21:07:11.694642+00:00.
- Snapshot B created at
2026-09-07T21:07:11.713800+00:00.
- Both returned basename
2026-09-07_210711_manual.json.gz, despite separate snapshot IDs.
This predates #242: base commit 4882480141e8e9d75ac8821c46d16e8c6bda7eef, src-tauri/src/commands/snapshot.rs:38–42, uses %Y-%m-%d_%H%M%S plus trigger type. serialize_and_compress uses File::create, which truncates that existing path. delete_snapshot removes the shared file.
Affected version: 1.2.0 / base commit above. Keep this fix separate from the scene revisions feature. Use a unique snapshot identifier (or collision-proof creation) in the filename.
Problem
Two snapshots of the same project and trigger type created within one second use the same backing filename. Their metadata rows have distinct IDs, but the second write overwrites the first file. Deleting either snapshot then removes the file used by the other.
Reproduction
create_snapshottwice in rapid succession, with different names andtrigger_type: "manual"(the same collision also applies to repeated export-triggered snapshots).file_pathmatches.Expected: independent backing files; removing one snapshot leaves the other restorable.
Actual: preview/restore of the surviving entry fails because its shared file has been deleted. If prose changes between creation calls, the earlier entry also restores the later content.
Evidence
Reproduced through the running Tauri app during #242 validation using a disposable imported project:
2026-09-07T21:07:11.694642+00:00.2026-09-07T21:07:11.713800+00:00.2026-09-07_210711_manual.json.gz, despite separate snapshot IDs.This predates #242: base commit
4882480141e8e9d75ac8821c46d16e8c6bda7eef,src-tauri/src/commands/snapshot.rs:38–42, uses%Y-%m-%d_%H%M%Splus trigger type.serialize_and_compressusesFile::create, which truncates that existing path.delete_snapshotremoves the shared file.Affected version: 1.2.0 / base commit above. Keep this fix separate from the scene revisions feature. Use a unique snapshot identifier (or collision-proof creation) in the filename.