Hi Ziqiao,
The important detail is step 3 - the user hasn't even opened Device B in weeks so that device is totally out of the loop. It's unaware of any deletions (or any changes at all) that have happened since step 1.
Everything was synchronized initially, but then the user starts deleting items on Device A, which get synced up to iCloud.
Meanwhile, back on device B, the app has been left unopened for weeks. When the user opens it up, they'll get .changeTokenExpired, and I'll fall back to the "unify" logic, the same behavior we use the first time this device syncs.
I'm really confused about how deleted record ID's work. For my use case, it doesn't matter which device the record was created on - any device that has had a long delay between fetches such that it needs to do a full fetch will need a list of everything that was deleted on the server since the last fetch.
For example, a user initially creates a record on Device A, syncs it to iCloud, Device B fetches. Later on, the user removes it on Device A and so my application code on Device A also removes the record from iCloud.
Device B, weeks later, fetches for the first time. It needs to know that the record has been deleted since its last fetch, regardless of the fact that, sometime far in the distant past, Device A had originally created it.
Does that make sense?
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: