Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: IndexedDB corrupted and reset when no disk space #41877

Open
3 tasks done
shadow-light opened this issue Apr 17, 2024 · 1 comment
Open
3 tasks done

[Bug]: IndexedDB corrupted and reset when no disk space #41877

shadow-light opened this issue Apr 17, 2024 · 1 comment
Labels
30-x-y bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/linux

Comments

@shadow-light
Copy link

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.

@electron-issue-triage electron-issue-triage bot added the has-repro-gist Issue can be reproduced with code at https://gist.github.com/ label Apr 17, 2024
@shadow-light
Copy link
Author

Just to add another reproduction (several previous already): This affected another user recently. They lost all their data and confirmed they had run out of disk space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
30-x-y bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/linux
Projects
Status: 👍 Does Not Block Stable
Development

No branches or pull requests

2 participants