mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-24 10:37:03 -06:00
Document uids started at 1 in every process, so two instances sharing the recovery folder overwrote and deleted each other's entries, and file.recovery.open deleted each entry as soon as it was loaded, leaving nothing if the app died before the next checkpoint. - Uids are a random per-process base plus a counter (below 2^53). - Each instance holds a lock on owner-<id>.lock in the folder; entries record their owner, and recovery open skips a running owner's entries and removes stale lock files. - Opening an entry no longer deletes it: the recovered presentation keeps the entry's uid and takes ownership, so the snapshot stays until the next recovery save replaces it or a save/close removes it. - Entry files and metadata are both written via temp file + rename. Co-authored-by: Cursor <cursoragent@cursor.com>