Our app has a default context where most of the work is done, and a different context for creating and editing entities. Our PKSyncManager points to the default context. We synchronize between the contexts using NSManagedObjectContextDidSaveNotification and mergeChangesFromContextDidSaveNotification. When changes are merged into the default context they aren't synced to Dropbox because PKSyncManager only listens for NSManagedObjectContextWillSaveNotification on its context, which doesn't happen on our default context when merging changes.
We have a potential fix vijayj#1 with a couple issues:
- It requires the client code to call a new method
managedObjectContextDidSave: when the default context merges changes.
- This new method
managedObjectContextDidSave is getting called when updateCoreDataWithDatastoreChanges: saves changes from Dropbox, leading to inefficiency.
Our fork also fixes an issue where syncIDs are not set across related objects soon enough.
Our app has a default context where most of the work is done, and a different context for creating and editing entities. Our PKSyncManager points to the default context. We synchronize between the contexts using
NSManagedObjectContextDidSaveNotificationandmergeChangesFromContextDidSaveNotification. When changes are merged into the default context they aren't synced to Dropbox because PKSyncManager only listens for NSManagedObjectContextWillSaveNotification on its context, which doesn't happen on our default context when merging changes.We have a potential fix vijayj#1 with a couple issues:
managedObjectContextDidSave:when the default context merges changes.managedObjectContextDidSaveis getting called whenupdateCoreDataWithDatastoreChanges:saves changes from Dropbox, leading to inefficiency.Our fork also fixes an issue where syncIDs are not set across related objects soon enough.