Skip to content

Saving managed objects in different CoreData contexts doesn't sync to Dropbox #22

@vijayj

Description

@vijayj

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:

  1. It requires the client code to call a new method managedObjectContextDidSave: when the default context merges changes.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions