I have reports from a handful of users of my production app that data has disappeared. My app has been in development/production for over 2 years now and I have never observed this data loss or have been able to reproduce it.
Here is the information I have:
My app stores all of its data using
core data
I have
iCloud/Core Data
sync enabled. The sync is not working at all, but that is a separate issue all together.There is no mechanism in my app that deletes data without explicit permission from the user.
One user described the data loss occurring after reopening the app after a crash. Could the fact the fact the data went missing after the app closed imply that the
context
isn't saving?
My hunch is that this is either some weird issue with iCloud/Core Data
sync (see this) or my app on rare occasion does not save the context.
Regarding the saving, I should say that in 2 years of developing/testing the app I have never observed a save error. I should also point out that I do use the NSMergePolicy
NSMergeByPropertyObjectTrumpMergePolicy
for my context. I understand that the presence of a conflict without a merge policy can lead to save errors.
What are some potential causes for this data loss?