@deokhwa.lee hey I was hoping you could share how you resolved this issue. When you said "Forcing the ModelContainer to be reinitialized fixes the problem".. can you please explain how you do a force reinitialization of the ModelContainer? I've tried everything and can't get that workaround to work. I'm desperate to figure this out as I have frustrated customers waiting. Would be very grateful to you, thanks.
Post
Replies
Boosts
Views
Activity
I'm still experiencing this issue. Was hoping it was fixed with iOS18 but I'm still getting the "Change token expired" messages when reinstalling from the app store after deleting the app. Strangely, I see the error messages when deleting the app and installing from Xcode, but several seconds later it will eventually do the iCloud sync. But when just installing from the app store again it will never complete and fail. Can't figure out how to detect when this is happening and how to force an iCloud sync. I understand it's supposed to be automatic but not working that way.
I'm having this exact same issue and just can't get it fixed. Identical error message to what is posted above. And I'm not creating a ModelConfiguration or group container as above. This issue just started happening suddenly after my app has been in the appstore for 2.5 months. And now customers are complaining. Desperate to find a solution.
I'm having this exact same issue. Did you happen to discover a solution that you can share? My SwiftData app does the initial setup of the DB fine on one device but when installing on a second device the data comes back as empty, but is actually syncing in the background. If I knew what exactly what was happening with events I could put up a "synchronizing with icloud" modal or something. And if not data already exists, go ahead and create a demo database and update the UI. Thanks for any help.
I'm having this exact same issue. Did anyone here happen to work out a solution? My app will work perfectly after adding data but on a fresh install on another device the data is returned as empty. I tried listening for "NSPersistentStoreRemoteChange" events which do come in eventually and then re-fetching the data but not working yet. My gut tells me there has to be a better way. I looked into CKSyncEngine but I really thought it shouldn't be necessary with SwiftData persistence and the fact that my app works fine on the new device on the second launch.