[Bug]: IndexedDB corrupted and reset when no disk space #41877
Labels
30-x-y
bug 🪲
has-repro-gist
Issue can be reproduced with code at https://gist.github.com/
platform/linux
Preflight Checklist
Electron Version
30.0.0
What operating system are you using?
Other Linux
Operating System Version
Debian 12
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
IndexedDB should preserve its existing data when not able to perform any more writes.
Actual Behavior
IndexedDB becomes corrupted and Chromium resets it, deleting all existing data.
Testcase Gist URL
https://gist.github.com/shadow-light/e00da7bf774f343917627b72a03e075c
Additional Information
Please see the Gist for clear instructions on reproducing this. It happens every time for me.
This is a big problem for novice users who run out of disk space. I've had several cases of users losing all their data due to low disk space. I could only reproduce on Linux when there was absolutely no space, but I suspect it might occur earlier than that on different OSs.
I doubt Chromium will be interested in prioritising a fix for this, since browser data is expected to be transient. But on Electron the IndexedDB has been set to be unlimited, offering persistent data. If this can't be fixed then developers should be dissuaded from using IndexedDB and rely on an alternative like SQLite instead.
LevelDB appears to offer a method for recovering as much data from a corruption as possible, but Chromium appears to not use it and just wipes the whole database.
The text was updated successfully, but these errors were encountered: