CoreData Nullify Delete Rule inconsistently nils from background thread

Originator:heath.borders
Number:rdar://10737334 Date Originated:23-Jan-2012 12:09 AM
Status:Open Resolved:
Product: Product Version:
Classification: Reproducible:
 
23-Jan-2012 12:09 AM Heath Borders:
Summary:
When using a Nullify Delete Rule on a relationship, -[NSManagedObjectContext mergeChangesFromContextDidSaveNotification:] doesn't propagate both sides of the relationship when the parent is deleted and the child is inserted into a new parent.

Steps to Reproduce:

Insert parent and child managed objects into a sqlite persistent store from NSManagedObjectContext A.
On a background thread with NSManagedObjectContext B, delete the parent and insert a new parent, add the child to the new parent, and save the new parent.
On the main thread, call -[NSManagedObjectContext mergeChangesFromContextDidSaveNotification:].

Expected Results:
The new parent should have the child as a child, the child should have the new parent as its parent.

Actual Results:
The new parent has the child as a child, but the child has a nil parent.

Regression:

Notes:
If I specify "No Action" for the delete rule, everything works fine.
Printing the NSManagedObjectContext B's managed objects shows correct relationships.

23-Jan-2012 12:09 AM Heath Borders:
'CoreDataNullifyDeleteActionBug.zip' was successfully uploaded
Example project can also be found at:
https://github.com/hborders/CoreDataNullifyDeleteActionBug

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!