-
Notifications
You must be signed in to change notification settings - Fork 62
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
Specify behavior when document is not fully active #412
Comments
In Firefox we return our unknown error because we cleared the global from the factory when the iframe's window was cleaned up. In Firefox devtools this looks like:
We can probably improve the exception message we throw in Firefox at least. Throwing seems appropriate for a case like this where the API does not return a Promise. |
WPT for w3c/IndexedDB#412 Bug: 1473972 Change-Id: I83ce4c771232cae663753a8e12ff5b959dc9f484
Agreed re: throwing. For web locks it's spec'd to reject with an "InvalidStateError" DOMException, which seems reasonable to me. I'd prefer to reserve UnknownError for cases when we're in unspecable/untestable territory, whereas this is just an edge case but totally specable/testable. I don't feel strongly about it though. FWIW, in Chrome localStorage.getItem() throws a "SecurityError" DOMException and caches.open() returns undefined (not a Promise!). Wheee. |
Yes, InvalidStateError seems better and we're fine to change Firefox's behavior here (and have tests that enforce that as the right exception). Thanks! |
FWIW, i'm also getting this error with the MetaMask extension, and it completely fails to start now.
i have zero clue what goes wrong, where, and how to fix it. deleting the storage would mean hours of work lost. |
This sounds browser specific. If this is on Firefox, please file a bug against our IndexedDB component and I can respond there. If this is on another browser, please file against that browser (or the MetaMask extension). |
Related to #381
i = document.createElement('iframe');
i.src = location;
document.body.append(i);
ii = i.contentWindow.indexedDB;
ii.open('db');
- returns IDBOpenDBRequesti.remove();
ii.open('db');
- returns ???In Chrome this returns null. Throwing is probably more correct behavior. I haven't tested in other browsers.
The text was updated successfully, but these errors were encountered: