Changed contexts merging logic from SaveWithBlock methods #615

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

adams79 commented Dec 5, 2013

Merge all changes from Root saving Context in default context can cause unwanted behaviours if the changes are initilally generated in default context itself (Default Context -> Root Context -> Default context).
In many cases - especially on iOS 6 - deleted MO “reappears” in the default context after saving
with MR_saveToPersistantStore methods.
For this reason I’ve removed the observer from the root context and added an observer only for localcontext created in saveWithBlock methods

adams79 Changed context merging logic from SaveWithBlock methods
Merge all changes from Root saving Context in default context can cause
unwanted behaviours if the changes are initilally generated in default
context itself (Default Context -> Root Context -> Default context). In
many cases deleted MO “reappears” in the default context after saving
with MR_saveToPersistantStore methods.
For this reason I’ve removed the observer from the root context and
added an observer only for localcontext created in saveWithBlock methods
0521351
Contributor

tonyarnold commented Dec 10, 2013

Thanks @adams79. I'm not sure I completely follow why this change is necessary (although I'm reading back through the comments on PR #460).

Would you mind including some tests for this PR to verify that the issue that this fixes doesn't occur again?

tonyarnold was assigned Dec 10, 2013

The deprecated methods were not updated with the context hierarchy changes. This local context is a child of the default context, so the merge in this case would be unnecessary.

Owner

adams79 replied Dec 10, 2013

Hi,
you're right, I've not seen that the mainContext is the default in this case...

Contributor

tonyarnold commented Apr 8, 2014

Given the age of this issue, and the volume of issues we have to work through, I've decided to close this alongside a number of other older issues.

If you can still replicate the issue under the latest in-development version of MagicalRecord (3.0 at the time of writing), please feel free to re-open and one of @magicalpanda/team-magicalrecord will take another look. Thanks!

tonyarnold closed this Apr 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment