Post

Replies

Boosts

Views

Activity

Comment on SwiftData Fatal error: Editors must register their identifiers before invoking operations on this store
Edit: Unfortunately this change didn't fix the crash. I managed to reproduce it again, even after adding the actor requirement to the protocol: protocol ConsumptionSessionStorage: Actor { func isStorageEmpty() -> Bool func hasCreditCardSessions() -> Bool func sessionsIn(interval: DateInterval) throws -> [ConsumptionSession] func updateSessions(sessions: [ConsumptionSession]) throws func deleteAllSessions() } Back to the drawing board I guess.
2w
Comment on SwiftData Fatal error: Editors must register their identifiers before invoking operations on this store
In the factory function I only create one ModelContainer. If the creation fails for some reason, I clear the database and try again. Could this be an issue? I don’t create ModelContainers anywhere else. As for the entire ModelActor, I cannot rule out that more than one may exist in some cases. Is that a problem? Should it be a singleton?
2w