- At this point, all of the items deleted in step 2 have been re-downloaded onto Device B.
This doesn't sound right. I'd expect the following behavior:
a. If the deletion on device A (step 2) has already synchronized, the records would have been deleted from the server, and so would not be available for device B to download.
b. Otherwise, the records deleted on device A still exist on the server, and so would indeed be downloaded to device B, and yet, once the changes on device A is synchronized, device B should get the deleted record IDs when it fetches changes with a valid server change token (and hence remove records from the local cache). So the data will eventually synchronized.
c. If the changes on device A is synchronized concurrently while device B is fetching with nil token, device B should get the deleted record IDs as well (and hence remove the records), as mentioned in the second bullet in my previous post.
If you observe a different behavior, please share the details and I'd take a closer look from there.
But from your reply, it sounds like this will be an empty array on Device B because the deletions happened on Device A.
Is that true?
No, that's not why I said. In your case, when you fetch changes with a nil server change token from device B, the result set should include the deleted record IDs for the records that were originally created on device B. It's about which device did the creation, not the deletion.
If it's false, how do I resolve the problem described above (deleted records re-appearing on the rarely-used device)?
As I described above, the deleted record should either not appear at all, or appear and then disappear after the changes on device A is synchronized. Again, I'll be super curious about what happens if you see otherwise.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.