mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-12 13:33:19 +00:00
When a running app has to leave its recovery area (its lock file was removed and another app locked the area), its copies stay in the old area until it writes them again in its new area. Only that app knew this, so once the other app let the old area go, any app could offer, restore or discard those copies while their app still ran. The app now writes an entry `<new area>/keeps-<old area>` in its own area while copies of its documents are left in the old one, and removes it when none are. Another app that finds an area unlocked checks for such an entry, and treats the area as a running app's while the area that names it is held. After a crash the new area is no longer held, so the copies are offered as before. The heartbeat writes the entry again if it was removed.