Post

Replies

Boosts

Views

Activity

Reply to SwiftData document-based app crashes on undo/redo without ModelContext.transaction(block:)
The issue is still occurring with Xcode 26.4.1 (17E202) and macOS Tahoe 26.4.1 (25E253). I also noticed that, rarely, the following errors get logged when the app crashes instead of the error in my original post: SwiftData.DefaultStore save failed with error: Error Domain=NSCocoaErrorDomain Code=1570 "%{PROPERTY}@ is a required value." UserInfo={NSValidationErrorObject=<NSManagedObject: 0x9da1b20d0> (entity: ChildItem; id: 0x9d7f324a0 <x-coredata:///ChildItem/tA0242788-AD81-4A4A-82BD-92796386C7E75>; data: { index = nil; parentItem = "0x9d7f32380 <x-coredata:///ParentItem/tA0242788-AD81-4A4A-82BD-92796386C7E73>"; }), NSLocalizedDescription=%{PROPERTY}@ is a required value., NSValidationErrorKey=index, NSValidationErrorValue=null} SwiftData/ModelContext.swift:3256: Fatal error: Illegal attempt to resolve a fault against a store that is not known to this model context: PersistentIdentifier(id: SwiftData.PersistentIdentifier.ID(backing: SwiftData.PersistentIdentifier.PersistentIdentifierBacking.managedObjectID(0x9d7f32380 <x-coredata:///ParentItem/tA0242788-AD81-4A4A-82BD-92796386C7E73>))) SwiftData.ModelContext Can't show source file for stack frame 8: ParentItem.childItems.getter The file path does not exist on the file system: /var/folders/sb/kvhs_53d49n1djmvf6jbf6lh0000gp/T/swift-generated-sources/@__swiftmacro_12DocumentTest10ParentItemC10childItems18_PersistedPropertyfMa_.swift However, I don't know how to reproduce these specific errors. They get logged randomly and rarely. Most of the time, the error in my original post gets logged.
Topic: App & System Services SubTopic: iCloud Tags:
Apr ’26
Reply to SwiftData document-based app crashes on undo/redo without ModelContext.transaction(block:)
The issue is still occurring with Xcode 26.4.1 (17E202) and macOS Tahoe 26.4.1 (25E253). I also noticed that, rarely, the following errors get logged when the app crashes instead of the error in my original post: SwiftData.DefaultStore save failed with error: Error Domain=NSCocoaErrorDomain Code=1570 "%{PROPERTY}@ is a required value." UserInfo={NSValidationErrorObject=<NSManagedObject: 0x9da1b20d0> (entity: ChildItem; id: 0x9d7f324a0 <x-coredata:///ChildItem/tA0242788-AD81-4A4A-82BD-92796386C7E75>; data: { index = nil; parentItem = "0x9d7f32380 <x-coredata:///ParentItem/tA0242788-AD81-4A4A-82BD-92796386C7E73>"; }), NSLocalizedDescription=%{PROPERTY}@ is a required value., NSValidationErrorKey=index, NSValidationErrorValue=null} SwiftData/ModelContext.swift:3256: Fatal error: Illegal attempt to resolve a fault against a store that is not known to this model context: PersistentIdentifier(id: SwiftData.PersistentIdentifier.ID(backing: SwiftData.PersistentIdentifier.PersistentIdentifierBacking.managedObjectID(0x9d7f32380 <x-coredata:///ParentItem/tA0242788-AD81-4A4A-82BD-92796386C7E73>))) SwiftData.ModelContext Can't show source file for stack frame 8: ParentItem.childItems.getter The file path does not exist on the file system: /var/folders/sb/kvhs_53d49n1djmvf6jbf6lh0000gp/T/swift-generated-sources/@__swiftmacro_12DocumentTest10ParentItemC10childItems18_PersistedPropertyfMa_.swift However, I don't know how to reproduce these specific errors. They get logged randomly and rarely. Most of the time, the error in my original post gets logged.
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Apr ’26
Reply to SwiftData document-based app crashes on undo/redo without ModelContext.transaction(block:)
Hi Ziqiao, I've filed it under FB22539495. Best, Omar
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Apr ’26
Reply to SwiftData document-based app crashes on undo/redo with autosaveEnabled
Hi Ziqiao, I've filed it under FB22429615. I've also found some more potential bugs when using SwiftData, DocumentGroup, and UndoManager together. I'll try to document them over the coming days. Thanks, Omar
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Apr ’26