Perhaps Delta Chat should handle database corruption better

Perhaps Delta Chat should handle database corruption more proactively.

Relevant platforms: Running Delta Chat on a Raspberry Pi that would commonly use an SD Card, perhaps even phone internal storage (I haven’t found any good source whether eMMC actually handles fsync semantics under power loss any better than SD Cards), and similar. As pointed out here, SQlite doesn’t seem to prevent corruption for these uses. Silent ext4 bit flips could probably cause this as well.

Right now, if corruption happens, the UI just freezes “Updating…”.

Possible ideas:

  • Show an actionable error that offers to sync back from another client the user has. That would be the most actionable thing to offer in the UI that I imagine isn’t the most complicated solution.

  • Perhaps store the core account data separately in some small extra database? To be able to continue with that even if there is no full backup for the messages on another device…?

  • I’m curious about other ideas.