mentrena / SyncKit

Automatic CloudKit synchronization
https://mentrena.github.io/SyncKit/
MIT License
507 stars 59 forks source link

Fixes 0.7.8 #99

Closed mentrena closed 4 years ago

BlixLT commented 5 years ago

It seems that my issues are mostly fixed. Undo does not crash anymore (although it seems there is still some issues with it. Sometimes some changes do not go to another device after undo/redo. I am still debugging it and create an issue when I have more info). Once in awhile (last time it was yesterday) I experience quite a strange bug - after zone deletion (can't tell right now if it was manual zone deletion or by code/UI) - FetchdatabaseChangesOperation returns that zone as a changed zone, but when later SyncKit tries fetchZoneChanges with that zone, it returns "zone not found" error and SyncKit is unable to fix it. It ends sync with such error and when you try syncing again - the same thing happens. Not sure how common is such weird behaviour (not existing zone returned as changed zone). I think a fix could be simple - just handling zone not found error (result.error) in the loop for (zoneID, result) in zoneResults the same way as it is handled during fetchdatabasechanges: self.notifyProviderForDeletedZoneIDs(). Probably I should have created a new issue for this.

mentrena commented 5 years ago

I think the fix you suggest would make sense. Is the issue easy to reproduce? Could you maybe try to add the fix and see whether it solves the problem?

BlixLT commented 5 years ago

I created a pull request into fix-0.7.8 branch: https://github.com/mentrena/SyncKit/pull/103 . However, it happens rarely and I don't know steps to reproduce, but it happened several times.