0

I am using CloudKit to sync my app across devices.

At first everything seems to work as expected but after a while CloudKit seems to get caught in an endless loop and the debug console throws tons of these messages (several thousand in serial):

CoreData: debug: CoreData+CloudKit: -[PFCloudKitSerializer applyUpdatedRecords:deletedRecordIDs:toStore:inManagedObjectContext:onlyUpdatingAttributes:andRelationships:madeChanges:error:]_block_invoke(1018): Failed to find matching objectIDs for <CKRecordID: 0x60000330c000; recordName=1E0972A7-D9DD-44A7-88F9-3AD13B32A330, zoneID=com.apple.coredata.cloudkit.zone:defaultOwner> / <CKRecordID: 0x60000330c020; recordName=EE02B981-E54D-486B-95A1-AC0839671C27, zoneID=com.apple.coredata.cloudkit.zone:defaultOwner> in pending relationship: 0xe92e2f9c5a6d27e2 x-coredata://75AFDFFD-8E35-4B9F-AA61-C477073B435B/NSCKImportPendingRelationship/p8626

I guess the most important part is

Failed to find matching objectIDs for <CKRecordID: 0x60000330c000; ...

It's just the standard CloudKit implementation without any special custom code, therefore I have no idea where to start to investigate.

Is this normal, expected behaviour? I feel like this is slowing down my CloudKit sync quite a lot.

wildcard
  • 896
  • 6
  • 16

1 Answers1

0

I just found the issue on my side. During further investigation I realized that these messages came together with other messages referring to one specific entity. I preload Core Data from a json file with some data which eventually change from time.

For development purposes each time the app launches,I update my preloaded data from the json file It turned out that I created new objects during that update to run a comparison and forgot to delete the unnecessary objects right after.

Since that update process creates several hundred objects, that adds up quite fast. They were now floating around in core data without any purpose. And CloudKit had to sync them.

However, at the end it's still quite small data and why this causes into those cryptic debug messages and hours of syncing, is still a mystery for me.

wildcard
  • 896
  • 6
  • 16