mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-24 10:27:44 -06:00
A save makes the document clean, which queues discarding this session's now-redundant recovery copy — but that's only queued, on a background worker thread, the same as a print job. Closing the app right after Save (the very next frame, with no regular recovery_tick in between to notice and queue the discard, or with the discard queued but not yet finished by the worker) could race the process exiting before the copy was actually removed, so the next launch wrongly offered to recover a document that was in fact saved cleanly. Added Recovery::finish and Session::finish_recovery, mirroring the print spooler's own finish_pending_jobs, and call it from the same places: on_exit and the macOS hard-quit path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>