SwiftData: SwiftData.PersistentIdentifierImplementation) was remapped to a temporary identifier during save

I'm seeing a lot of these in my logs:

PersistentIdentifier PersistentIdentifier(id: SwiftData.PersistentIdentifier.ID(url: x-swiftdata://Course/BC9CF99A-DE6A-46F1-A18D-8034255A56D8), implementation: SwiftData.PersistentIdentifierImplementation) was remapped to a temporary identifier during save: PersistentIdentifier(id: SwiftData.PersistentIdentifier.ID(url: x-coredata:///Course/t58C849CD-D895-4773-BF53-3F63CF48935B210), implementation: SwiftData.PersistentIdentifierImplementation). This is a fatal logic error in DefaultStore

... though everything seems to work.

Does anyone know what this means in this context? Anything I can do to not have this appear?

I get this when I try inserting a new row that violates a unique constraint. I don't know how to suppress it, but I haven't tried that hard since it works as I want it to. I think.

Interesting... I thought that was just supposed to do an UPSERT (which it seems to do), though I thought that was by design and not something that should justify a warning.

Agree that it seems to work fine despite the scary error message.

I'm also seeing this when UPSERT-ing data.

Yeah, I'm seeing the same issue when performing UPSERTs. Additionally, for me, the upserts have suddenly become extremely slow. It seems like the operation finishes, but the result isn’t what I expect. Then, after a while (around 10 seconds for approximately 100 records), I get these warnings, and suddenly the expected results appear. Everything worked fine on iOS 17, so I’m not sure what has changed.

SwiftData: SwiftData.PersistentIdentifierImplementation) was remapped to a temporary identifier during save
 
 
Q