Experiencing the same thing. Any iCloud sync operation following an insert or modification of SwiftData objects freeze the UI. It is infuriating.
Post
Replies
Boosts
Views
Activity
UPDATE: It has not been fixed in Xcode 16 Beta 4; the error is still being thrown. Will continue to run the Swift 5 language mode until it has been resolved in a future beta.
I am getting the same problem. Although I am not using a ModelActor to remove my objects, I get the same error when removing an object via a context menu in my SwiftUI view. In theory, calling modelContext.delete should run without any issues; I am inclined to believe this is a bug.
I am having the same problem. For me, it occurs when I attempt to delete a SwiftData model with a one-to-many relationship with other SwiftData models. The same code that throws the error in MacOS 15 works fine in MacOS 14, so I am inclined to believe it is a bug.
I am encountering a similar problem as you, this time on MacOS Sonoma 14.5. Our team's code for integrating SwiftData and CloudKit is similar to yours and closely follows the official documentation from Apple regarding SwiftData and CloudKit: https://developer.apple.com/documentation/swiftdata/syncing-model-data-across-a-persons-devices
Our code worked on previous versions of Sonoma, but since updating to 14.5, we have consistently encountered the issue you are having, and it is infuriating. I am currently investigating why ours is failing, but it is frustrating to follow the documentation and still see our app crash.
I am experiencing something similar with my Mac app. Having investigated using the Instruments tool, it seems that my app is constantly fetching data, causing the main thread to be blocked and making the UI unresponsive. I wasn't encountering this in Beta 5, but I am in Beta 6.
I did run a smaller app that leverages SwiftData on the iOS Simulator, and I'm not getting 100% CPU usage. Strange
Has the issue been resolved for you in Beta 6? I didn't encounter this issue in Beta 5, however I am encountering this issue in Beta 6. Haven't found a solution to the problem yet but still looking.
I have observed this as well. I'm currently running Xcode 15 Beta 6 on Sonoma Beta 5. While my app doesn't crash as a result of a memory leak, I just slowly see the memory consumption go up. Other notable issues include 100% CPU usage, which blocks the main thread and therefore makes my app's UI unresponsive.