Closed Bug 1629200 Opened 4 years ago Closed 2 years ago

Storage estimate doesn't return correct usage and quota after persistent storage is granted

Categories

(Core :: Storage: StorageManager, defect, P3)

75 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1593646

People

(Reporter: zeroliu, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92 Safari/537.36

Steps to reproduce:

  1. Grant persistent storage with navigator.storage.persist()
  2. Check usage and quota with navigator.storage.estimate()

Actual results:

Quota is still 2048MB. Usage is always 0.

Expected results:

Quota should be 50% of disk space. Usage should report the actual usage.

Flags: needinfo?(ttung)

UA: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:75.0) Gecko/20100101 Firefox/75.0

Version: 74 Branch → 75 Branch

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Storage: Quota Manager
Product: Firefox → Core

(In reply to Xiyuan Liu from comment #0)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92 Safari/537.36

Steps to reproduce:

  1. Grant persistent storage with navigator.storage.persist()
  2. Check usage and quota with navigator.storage.estimate()

Actual results:

Quota is still 2048MB. Usage is always 0.

That's a known issue for the current storage API.
The reasons for this are:

For navigator.storage.estimate (from my understanding) is that most web developers care about the diff for quota and usage rather than the exact value of usage.

Combine things above, we implement storage API v1 as it is and this issue might not be fixed in the near future.

Blocks: 1254428
Component: Storage: Quota Manager → Storage: StorageManager
Flags: needinfo?(ttung)
See Also: → 1374970

Well, bug 1374970 is a bit different issue, it doesn't mention navigator.storage.persist() at all.
I think a discussion about this issue started in bug 1267941 comment 35 and it seems we took the easier option, returning zero usage when an origin is persisted.

In theory, we could return exact group usage in both cases (not persisted/persisted), but as :asuth mentioned in bug 1593646 comment 3, we probably want to address bug 1552848 first.

See Also: → 1593646

Thanks for the prompt response. I agree that the security issue should be the top priority. Please keep us update!

A side note, how does today's estimate API prevent us from leaking opaque response? The estimate seems to be pretty granular.

(In reply to Xiyuan Liu from comment #6)

A side note, how does today's estimate API prevent us from leaking opaque response? The estimate seems to be pretty granular.

Opaque responses have random padding associated with them at a granularity that attempts to limit the amount of entropy that can be gained from repeated fetches and storage of the opaque responses.

Priority: -- → P3

Resetting severity to default of --.

Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is P3 (Backlog,) indicating it has been triaged, the bug's Severity is being updated to S3 (normal.)

Severity: normal → S3
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.