CoreData Nullify Delete Rule inconsistently nils from background thread

Originator:heath.borders
Number:rdar://10737334 Date Originated:23-Jan-2012 12:09 AM
Status:Closed Resolved:
Product: Product Version:
Classification: Reproducible:
 
23-Jan-2012 01: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 01:09 AM Heath Borders:
'CoreDataNullifyDeleteActionBug.zip' was successfully uploaded

26-Jun-2012 09:59 AM Heath Borders:
Fixed in Xcode Version 4.5 (4G108j)

Comments

Fixed in iOS6

Just tested on Xcode Version 4.5 (4G108j) and it is fixed now.

By heath.borders at June 26, 2012, 3 p.m. (reply...)

Duped as 10972671

By joseph.hainline at March 2, 2012, 6:45 p.m. (reply...)

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!