Cascade delete does not work

Originator:darren.mo
Number:rdar://FB13445046 Date Originated:2023-12-04
Status:Open Resolved:
Product:SwiftData Product Version:iOS 17.2 Seed 3 (21C5046c)
Classification:Incorrect/Unexpected Behavior Reproducible:Always
 
I have attached a sample project demonstrating the usage of `DeleteRule.cascade` on a one-to-many relationship. The cascade delete does not work. Only the objects that I explicitly specify to be deleted are actually deleted and the other side of the relationship is set to `nil`.

Comments

Apple

After reviewing your feedback, we have some additional information for you, or some additional information, or action is necessary for this issue:

We checked the store before and after the deletion of the parent was performed and the delete cascades- objects from both sides of the relationship are deleted. Tested with the sample application provided.

Please close this feedback report, if there's nothing else you need from us here.

By darren.mo at May 1, 2024, 4:34 a.m. (reply...)

Me

I am still able to reproduce the issue with iOS 17.5 Beta 2. See the attached screenshot. I have circled the issue in red. After deleting the parent, the child is still alive and its parent relationship is set to nil.

Are you sure you checked the right store? The sample application uses an in-memory store.

By darren.mo at May 1, 2024, 4:34 a.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!