We are seeing a rare issue reported (0.15% of users) where a user starts our app and the app fails as the database can’t open. For these devices we see the following on our error logging platform…
Domain: SQLite Code: 11 NSLocalizedDescription: database disk image is malformed
Restarting the app does not solve it. If they restart their device and wait for a period of time (1 minute is the shortest amount we have asked someone to wait so far), then it will then successfully open the database. If they open the app immediately on restarting they get the same error.
I have no idea what could be going on if restarting and waiting makes a difference. If SQLite reports file corruption, that should be something intrinsic to the file that wouldn’t go away on its own.
What is the file protection entitlement of your app set to?