Closed Bug 1714241 Opened 5 years ago Closed 5 years ago

Firefox throws DOMException error caches.keys()

Categories

(Core :: Storage: Cache API, defect)

Firefox 89
defect

Tracking

()

RESOLVED DUPLICATE of bug 1714354

People

(Reporter: brodhead.tom, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36

Steps to reproduce:

Any JavaScript that includes caches.keys() will fail.

Simply run console.log(caches.keys()); in the Firefox DevTools console to see.

Actual results:

The Promise is not resolved and this error is reported:

Uncaught (in promise) DOMException: The operation is insecure.
Promise { <state>: "rejected", <reason>: DOMException }
<state>: "rejected"
<reason>: DOMException: The operation is insecure.

Expected results:

The Promise resolves with the following reported (see commentary below):

Promise {<pending>}
proto: Promise
[[PromiseState]]: "fulfilled"
[[PromiseResult]]: Array(0)

The above is what is reported in the console of the DevTools in Chromium browsers. This is consistent with the documented behavior of caches.keys(), as found here:
https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage/keys

The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Console
Product: Firefox → DevTools

This isn't a DevTools::Console issue; it's something affecting JavaScript that can be illustrated easily in the console, which is why I supplied the example of how to reproduce it there.

How do I revert the change?

(In reply to Release mgmt bot [:sylvestre / :calixte / :marco for bugbug] from comment #1)

The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

See my comment above...this is a JavaScript issue. It can easily be demonstrated in the Console, which is why I described how to reproduce it there. How do I reverse the classification?

Would you have a page we can test this on? I am not able to reproduce the issue locally

Flags: needinfo?(brodhead.tom)

(In reply to Nicolas Chevobbe [:nchevobbe] from comment #4)

Would you have a page we can test this on? I am not able to reproduce the issue locally

I've discovered that this only happens in a Private/Incognito window in Firefox, not in a standard window...my apologies for not catching this when first reporting it.

I've just reproduced it in a Private window in both the current Firefox (89) and the Firefox Developer Edition (90.0b1). It does not occur in Incognito windows in Chromium browsers.

I've created a short web page that illustrates it: https://thomasbrodhead.com/caches-keys

Open the page in a Private window in Firefox with the DevTools Console window open and you should see the error message; see the page source for the JavaScript. You should also be able to reproduce it by entering console.log(caches.keys()); in the same console.

Flags: needinfo?(brodhead.tom)

Thanks for the demo page!
Let's move this to the right component so the team can look at it

Component: Console → Storage: Cache API
Product: DevTools → Core

Cache API isn't supported in private browsing at this time. I've filed bug 1714354 as an up-to-date bug about our plans for how to support Cache API in private browsing, which I'm duping this to. I do believe we may have some bugs open in the storage space in general (and in particular, on IndexedDB) about the exceptions we report for cases like this where we're intentionally generating a storage-access failure but where that can be confusing.

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