Files
wordcraft/crates/engine
SofiaAFigueredoandClaude Sonnet 5 6b66f88f7c file.save: don't stamp the document when the write fails
CodeRabbit catch on PR #3434: stamp_save() ran before the fallible
save_path_with(), so a failed write (no permission, disk full, a bad
path) still bumped the document's modified time, revision, author and
zoom, as if it had actually been saved. A later successful save would
then persist those stale stamps for a write that never happened.

Snapshot the stamped fields before stamp_save() and restore them if
save_path_with() errors, before propagating the failure.

Added a_failed_save_leaves_the_save_stamps_untouched in
crates/engine/src/tests.rs. cargo test -p wordcraft-engine --lib: 789
passed. clippy -p wordcraft-engine --lib --tests -D warnings: clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-21 09:39:54 -03:00
..