With that minimal example, (now testing on beta 6), if you add some items, after ~45 seconds those faults appear in the logs. This happens consistently, though doesn't seem to affect functionality.
In beta 6, my larger app seems to be able to function fine while still emitting these log lines (previously it would fail to save new models in the context)
Post
Replies
Boosts
Views
Activity
This seems to be working for me on iOS17, but regressed in iOS 18 betas (as of beta 5). Filed as FB14750050
I've tried fetching the items from the main context, but it doesn't seem to force a redraw.
Thank you for confirming the change. Is this going to be a documented limitation of SwiftData?
It is useful to be able to express the immutability of particular model attributes. I can understand if SwiftData may now be unable to handle that immutability constraint, but that change seems like it should be a documented property of SwiftData and not just a compiler error.
If it isn't a SwiftData design decision but a limitation of macros I would encourage the restoration of the previously shipping behavior.