Instead of using addRecord with generics I switched to concrete type and it is not hitting assert() anymore:
func addWorkspace(_ someDTO: WorkspaceDTO) async throws {
var zone: ZoneModel? = nil
let recordName = someDTO.recordNameType
let fetchDescriptor = FetchDescriptor<WorkspaceModel> (predicate: #Predicate {$0.recordName == recordName})
var localEntitites: [WorkspaceModel] = try modelContext.fetch(fetchDescriptor) <---- no more crash here
So it seems that Fetch Descriptor crashes only if I use it with generics. Not with concrete types. Anyway, seems like a bug in swiftData.
Post
Replies
Boosts
Views
Activity
Did you figure out if it is possible to use CloudKit from command line applications?
In Xcode I don't see CloudKit entitlements
Did you figure this out?