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
Inconsistent reporting of offline storage quota #16029
Comments
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines. |
Interested in the answer to this as well |
Tested again in Electron 4.0.5 with the same results. Is there any official word? |
I wonder if this has anything to do with the disabling of the DOM storage quota checks in |
According to #9498 (comment) it sounds like there is "unlimited and durable storage for all origins", which seems like it would agree with the "100% available" result you mentioned. |
@jacobq: agree, but it would be nice to see this officially documented somewhere. I can't base my app on this assumption and then have data loss because something got evicted. |
Has anyone found the documentation for the limits yet? |
@elrDevelopment https://en.wikipedia.org/wiki/Web_storage However, Electron has a patch for dom storage limits: https://github.com/electron/electron/blob/master/patches/chromium/dom_storage_limits.patch |
@elrDevelopment I believe that's only for |
I believe that to be the case as well. But cant find anything in the DOCS about it. |
This is implementation-specific I believe. The docs regarding storage rules can be found here, so the actual limit can range up to 2GB |
@lvkins: Thanks, but the contents on the mozilla site and wikipedia are pretty generic, and not really what this issue is about. The original question is specifically about IndexedDb. The code shown above contradicts everything I can find documented regarding IndexedDb limits and data eviction for Chrome. I'm specifically trying to determine what the situation is for Electron which does not appear to be documented anywhere. I've tested again in Electron 7.1.2 and still see the same results: available storage quota is the total free space on the drive, minus any space already used for persistent storage. |
Indeed, those links I posted were directed to the @elrDevelopment that asked for the docs. Regarding this issue, that I'm subscribing for few months out of curiosity, A good idea might be to test chromium behavior on that, because there seem to be no regulations in electron regarding this. If you will be able to reproduce same behavior on standalone chromium build and you are determined enough, you can dig into the chromium IndexedDb implementation. There is a documentation available if you're interested. Quite outdated, but might be a good starting point for digging. Otherwise, if you don't wanna get your hands dirty, I encourage you to post this issue at chromium repo. |
@mann-david not sure why this is so hard for a person from the electron team couldn't answer this. |
@zcbenz @deepak1556 Would you mind taking a moment to help clear this up? There seem to be some apparently contradictory claims here:
|
I've given up on IndexedDB simply because I couldn't get an answer on this and couldn't risk my product on it changing. |
It seems that the storage quota in Electron is unlimited: I think we can provide an API to let users set the storage quota themselves. |
I'm looking into how Chromium calculates the storage quota, it seems that their algorithm is: I have also tested with Chrome 79 and it returned all free disk space as storage quota. |
This behavior seems to be intended: |
I did some testing myself and it appears that indexeddb quota is pretty high, if not unlimited as stated. |
I'm closing this issue since Electron's behavior aligns with Chromium. |
Expected Behavior
According to all documentation I can find, including Issue #4550, Electron should have 1/3 of free space available for offline storage. In addition, our apps should only be able to use 20% of that, per https://developer.chrome.com/apps/offline_storage#table.
Actual behavior
I run the following code inside my Electron app:
and it reports that I actually have 100% of my free disk space available (i.e my 200GB drive has 105 GB free, and the code reports 105 GB available for use). I've tried this on multiple machines with 3 different Electron apps and it is consistent.
If it matters, I'm specifically interested in IndexedDb.
To Reproduce
Run the above code inside any Electron app (either in the app or just in the console inside the renderer process). Compare the results to the actual free space on your drive.
Additional Information
Primarily, I'm just looking for a clarification on whether what I'm seeing in the code is correct, that we have 100% of free disk space, or whether the documentation is correct and the code incorrect. Secondarily, I'd like to know if Electron will ever evict my data (specifically IndexedDb).
Thanks.
The text was updated successfully, but these errors were encountered: