mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-18 08:25:34 +00:00
Two real issues CodeRabbit caught in the first commit, both in Recovery::finish: - It didn't repeat tick's own guard against a stale self.id: if the session switched documents with no regular tick in between to notice and reset that identity, finish would discard the *previous* document's still-live recovery copy under the *new*, clean document's state. Added the same self.document == document_id() check tick already uses, and a test reproducing it (confirmed it fails without the guard). - An in-flight job failing (e.g. a stray autosave) returned immediately via `?`, skipping the clean-document discard below it entirely — so a save that really did land cleanly right before exit could still leave a stale copy, for an unrelated reason. Keeps that error to return at the end instead, after still attempting the discard. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>