mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +00:00
A zone deleted from another device — a reset, an iCloud data purge — arrives as an event on every other device, and the handler answered it by calling back into the sync engine from inside the engine's own callback. CloudKit traps on that, in release, so the app died a second after the push; and because the handler destroyed the persisted sync state before doing the work, the relaunch saw a zone that existed again, no local sign anything was lost, and never noticed the wipe. Both devices then reported being in sync with an empty zone. The handler now only writes a durable marker and mutates engine state: the zone is recreated through pending database changes — which also gets past the zone manager's memo — and the re-upload is registered, never sent. The engine sends on its own schedule. The marker is written before any of it and retired only after the engine serializes the state the recovery registered, so a crash anywhere in the middle is redone on the next launch. Accounts lead the re-seed now instead of trailing nine categories behind it. They carry the logins, the tombstones and the selected context, and going last is how a wipe took them with it. A purge is not a reset: CloudKit requires that data deleted that way is not sent back, so those reasons drop what was queued rather than republish it. Local data stays — it is this app's store, not a cache of the zone. And the reset that promises "your local data has been re-uploaded" now does it.