SyncKit icon indicating copy to clipboard operation
SyncKit copied to clipboard

SyncError on macOS

Open teawithfruit opened this issue 3 years ago • 1 comments

I'm trying to implement an app with sync between iOS and macOS. Now I'm at the pint where a notofication from CloudKit should trigger the sync. On iOS everything works fine, but not on macOS. If I start the sync process with synchronizer?.synchronize(completion: ((Error?) -> ()) I got a "CloudKitSynchronizer >> Initiating synchronization" print on the console and a following SyncError without any further information.

I think this error raises because of an empty zoneID in line 35 of the following code. https://github.com/mentrena/SyncKit/blob/1a1c0409a1d25b67eb522842a3764442e2a3fbd9/SyncKit/Classes/QSSynchronizer/Operations/FetchDatabaseChangesOperation.swift#L28-L55

@mentrena it would be really cool if you could have a look at this.

teawithfruit avatar Dec 28 '21 23:12 teawithfruit

SyncError is an Int enum, do you know which case you're getting?

For reference:

@objc public enum SyncError: Int, Error {
        /**
         *  Received when synchronize is called while there was an ongoing synchronization.
         */
        case alreadySyncing = 0
        /**
         *  A synchronizer with a higer `compatibilityVersion` value uploaded changes to CloudKit, so those changes won't be imported here.
         *  This error can be detected to prompt the user to update the app to a newer version.
         */
        case higherModelVersionFound = 1
        /**
         *  A record fot the provided object was not found, so the object cannot be shared on CloudKit.
         */
        case recordNotFound = 2
        /**
         *  Synchronization was manually cancelled.
         */
        case cancelled = 3
    }

mentrena avatar Jan 10 '22 12:01 mentrena