Hi @SimplyKyra ,
this is really and interesting approach with SwiftData (wrapper on CoreData framework) and concurrency programs.
The issue could be in the creation of the sub issue inside the taskGroup.
I think that the problem could be in a concurrency access on ModelContext inside all single task groups. Putting a @MainActor on this method
@MainActor
internal final func createSubIssue(in container: ModelContainer, issueID: PersistentIdentifier, name: Int) async -> String?
resolve the concurrency problem on ModelContext, but I'm not sure could be the right approach, I attached a screenshot.
On CoreData framework there is the concept of background managed context (model Context is the SwiftUI name of this object).
Think you should follow this approach on SwiftUI
https://developer.apple.com/documentation/coredata/using_core_data_in_the_background
Bye
Rob
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: