New issue
Advanced search Search tips

Issue 841568 link

Starred by 5 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Storage quota error isn't raised when putting empty response into CacheStorage

Project Member Reported by claywoolam@google.com, May 9 2018

Issue description

Chrome Version       : 66.0.3359.139
OS Version: OS X 10.13.4

What steps will reproduce the problem?
1. Fill up quota with dummy data
2. Put empty response data in the cache, it will succeed:
 > await caches.open('test').then((c) => c.put('/test', new Response()));
 > undefined
3. Put 1-byte response in the cache, it will fail
 > await caches.open('test').then((c) => c.put('/test', new Response('a')));
 > Uncaught (in promise) DOMException: Quota exceeded.

What is the expected result?
Quota exceeded error with the empty response object.

What happens instead of that?
I can write data in excess of the storage quota. Seems like I can write arbitrarily as much data as I want.

UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36

 
Labels: Needs-Triage-M66
Cc: vamshi.kommuri@chromium.org
Components: Blink>Storage
Labels: Needs-Feedback Triaged-ET
Thanks for filing the issue!

@Reporter: As we are not very clear about the steps to be performed in comment#0(i.e., where to fill up quota with dummy data...), Could you please share any sample test file/URL which helps us to triage the issue in a better way. Any further inputs from your end may be helpful.

Comment 3 by jsb...@chromium.org, May 11 2018

Components: -Blink>Storage Blink>Storage>CacheStorage Blink>Storage>Quota
Labels: -Needs-Feedback -Needs-Triage-M66 Hotlist-GoodFirstBug
Status: Available (was: Unconfirmed)
Removing "Needs-Feedback" label since I'm in touch with the reporter.

Sounds like we're not including header size in the byte delta:

https://cs.chromium.org/chromium/src/content/browser/cache_storage/cache_storage_cache.cc?q=quota_manager+file:%5Esrc/content/browser/cache_storage/+package:%5Echromium$&dr=C&l=534

We could either compute the header size or use a conservative fixed value (e.g. 2kB)

Sign in to add a comment