drewmccormack / ensembles

A synchronization framework for Core Data.
MIT License
1.63k stars 131 forks source link

Ensembles Error merging: Error Domain=CDEErrorDomain Code=207 #156

Closed ducky007 closed 10 years ago

ducky007 commented 10 years ago

I have integrated Ensembles using the examples provided in the documentation. Syncing works well at first, but always ends in one device getting an - Error merging: Error Domain=CDEErrorDomain Code=207 "The operation couldn’t be completed. (CDEErrorDomain error 207.)". According to the explanation, this error means that a save to the persistent store occurred during merge and we should retry the merge.

Even after retries, the merge never succeeds. This seems to permanently break the sync. I have placed log statements to make sure I am not saving inadvertently. What else could cause this error?

2014-06-20 22:28:26.118 App[1539:490b] -[CDEEventIntegrator integrate:] line 297: Integrating new events into main context 2014-06-20 22:28:26.132 App[1539:490b] __32-[CDEEventIntegrator integrate:]_block_invoke line 315: Baseline has changed. Will carry out full integration of the persistent store. 2014-06-20 22:28:30.280 App[1539:490b] -[CDEEventIntegrator repairWithMergeEventBuilder:error:] line 793: Repairing context after integrating changes 2014-06-20 22:28:30.283 App[1539:490b] -[CDEEventIntegrator commitWithMergeEventBuilder:error:] line 1030: Committing merge changes to store 2014-06-20 22:28:30.323 App[1539:490b] -[CDESaveMonitor storePreSaveChangesFromUpdatedObjects:] line 126: Storing pre-save changes from updated objects 2014-06-20 22:28:30.328 App[1539:490b] -[CDESaveMonitor storePreSaveChangesFromUpdatedObjects:] line 126: Storing pre-save changes from updated objects 2014-06-20 22:28:30.337 App[1539:490b] -[CDESaveMonitor contextDidSave:] line 163: Storing changes post-save 2014-06-20 22:28:30.455 App[1539:60b] Error merging: Error Domain=CDEErrorDomain Code=207 "The operation couldn’t be completed. (CDEErrorDomain error 207.)"

drewmccormack commented 10 years ago

There is definitely a save happening, because the CDESaveMonitor is catching the notification. I would double checked, perhaps set a break point and catch the did-save notification to see where it is saving.

ducky007 commented 10 years ago

Thanks. That got me looking in the right direction. My app was setting up ensembles twice which seems to have been causing the issue.