New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 651490 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Indexed DB usage reported via Quota API is inconsistent

Project Member Reported by jsb...@chromium.org, Sep 29 2016

Issue description

Per Eiji Kitamura:

"When I added 100MB to File System, WebSQL results are as expected. Remaining quota in "Quota" section increased by 100MB. But when I tested it on IndexedDB, it only increased by 14MB though IndexedDB part indicates 100MB. I'm sure this is not a bug on the tool because it works fine on other browsers."

This is using http://demo.agektmr.com/storage/

We should try and repro and figure out what's going on.
 

Comment 1 by pwnall@chromium.org, Sep 29 2016

Status: WontFix (was: Unconfirmed)
I think I was able to repro the referenced behavior in Chrome Beta (54) and Canary (55) on Mac, and on Chrome Dev (55) on Android. Repro steps are as follows:

1. Go to http://demo.agektmr.com/storage/
2. Under Quota, select Persistent, fill in 500 for MB, click the "Request Quota" button
3. Under IndexedDB, select Upload File, find a < 100MB file on your computer, upload it
4. Go back to Quota, notice that nothing changed
5. Under FileSystem, select Upload File, use the same file
6. Go back to Quota, notice that that the file is now measured towards quota usage

However, if the Temporary quota is selected, IndexedDB's usage does show up. So I'm guessing the reporter was expecting IndexedDB to show up under Permanent, not under Temporary? The spec [1] states that IndexedDB can use either temporary or permanent storage, so we're in compliance.

Curiously, the spec also mentions that IndexedDB will get a switch for specifying whether it should use temporary or permanent storage. The IndexedDB (v2) spec [2] says no such thing.

I'm not sure what "it works fine on other browsers" in the description means. AFAIK, Chrome is the only browser that supports the quota API. I checked Firefox Dev (51) and Safari (10.0.1), and the tool states that they don't support the Quota API.

Based on all the information above, I think that we're fine. If we do decide to change something, the first interesting bit of logic is in QuotaManager::GetUsageAndQuotaForWebApps.

The improvements that I think this tool suggests are:
(1) Perhaps we want to let IndexedDB count against the permanent quota, if the app has it. That seems to be a non-trivial spec change.
(2) Removing the IndexedDB data on Android didn't reset the quota usage to zero. That'd be its own bug.

jsbell: Please feel free to reopen if I missed something.

[1] https://www.w3.org/TR/quota-api/#quota-handling-in-storage-apis
[2] https://w3c.github.io/IndexedDB/#dom-idbfactory-open

Comment 2 by jsb...@chromium.org, Sep 29 2016

https://www.w3.org/TR/quota-api/ should probably be formally deprecated. It's abandoned in favor of https://storage.spec.whatwg.org/#api which introduces an origin-wide persistent permission rather than the temporary/persistent namespace split.

Only Chrome's filesystem API uses the legacy persistent storage namespace.

Hi, I'm the original reporter.

I just remembered that Quota Management API persistent storage was only supported by FileSystem API and not by others including IndexedDB, WebSQL, AppCache etc at least back when I originally examined the behaviour http://www.html5rocks.com/en/tutorials/offline/quota-research/

So it's expected behaviour that persistent storage gauge didn't change when you upload 100MB into IDB.

> I'm not sure what "it works fine on other browsers" in the description means.
This was my misunderstanding and "it works fine on other browsers" is not necessarily true at this point. You are correct. But it just reminded me of an interesting observation on Firefox when I was looking at actual quota usage. Firefox uses (at least used to use) sqlite and I was observing it and figured that it compresses stored entries. It caused me hard time figuring out actual disk usage to see quota consumption.

I wonder if Chrome changed behaviour and compresses IndexedDB's stored entires.

Comment 4 by jsb...@chromium.org, Sep 30 2016

Yes, Chrome now compresses Indexed DB data, starting about 3 years ago.

OK, then 100MB > 14MB should be expected I assume.

Sign in to add a comment