SwiftData error on IOS18, Never access a full future backing data

try to update my app from iOS 17 to io 18, I'm using SwiftData to save the data on the memory, on iOS 17 all works fine but I tried to export my app to iOS 18 and I get a strange error when I try to delate a playlist from SwiftData memory.

Thread 10: Fatal error: Never access a full future backing data - PersistentIdentifier(id: SwiftData.PersistentIdentifier.ID(url: x-coredata://4885953A-BDB2-4CD1-9299-B2FBBB899EB7/PlaylistItem/p372), implementation: SwiftData.PersistentIdentifierImplementation) with Optional(B2A80504-2FE1-4C86-8341-3DDE8B6AB913)

the code where this error happen is very simple,

  func deletePlaylist(_ playlist: PlayListModel) async throws {
        print("attempt to delate :, \(playlist.playlistName)")
        context.delete(playlist)
        try context.save() // error here on the save 
    }

Error only happen on iOS 18 not on the 17.

I'm seeing the same thing but only when I attempt to delete a record that is somehow corrupted

I am seeing the same error when I try to delete models that have a relationship set to cascade delete. The crash does not occur if the relationship is empty when deleting the model.

FB14041374

It's a different error but in a same sense that Bindings try to access deleted SwiftData entities rather than switching to default values.

Thread 1: Fatal error: Context is missing for Optional(SwiftData.PersistentIdentifier(id: SwiftData.PersistentIdentifier.ID(url: x-coredata://A6A3F87C-9EA0-43F7-BD6D-A31364117257/Profile/p5), implementation: SwiftData.PersistentIdentifierImplementation))
SwiftData error on IOS18, Never access a full future backing data
 
 
Q