WebExt browser.storage.local broken after Services.qms.clear()
Categories
(WebExtensions :: Storage, defect, P3)
Tracking
(firefox69 affected, firefox70 affected, firefox71 affected)
People
(Reporter: acat, Unassigned)
Details
In Tor Browser we currently call Services.qms.clear()
(after temporarily switching on dom.quotaManager.testing
pref) in order to clear asm.js caches, which at some point were not aware of Private Browsing Mode. When switching to ESR 68 we realized that this was breaking the browser.storage.local
WebExtension API. This does not happen when using the old backend (extensions.webextensions.ExtensionStorageIDB.enabled
= false).
Reproduced in Firefox 68:
- Create a new profile.
- Install NoScript from AMO.
- Set
dom.quotaManager.testing
pref to true. - Call
Services.qms.clear()
in browser console. - Set
dom.quotaManager.testing
pref to false. - Open debug addon window for NoScript in about:debugging.
- Run
browser.storage.local.set({foo:bar})
, it throwsInvalidStateError: A mutation operation was attempted on a database that did not allow mutations..
indexedDB itself seems to work fine in WebExtensions, so maybe Services.qms.clear()
leaves the ExtensionStorageIDB
in an invalid state?
Comment 1•5 years ago
|
||
Let's first see if this is a web extensions issue.
Comment 2•5 years ago
|
||
clear() will break all open IndexedDB databases, so the database will need to be re-opened, yes. Tor is probably better off using the Sanitizer.jsm logic if you want to clear all storages rather than using a testing-only QuotaManager API. (Sanitizer will find out the origins in use and then clear the origin specifically. And QuotaManager supports clearing specific clients to boot.)
Updated•5 years ago
|
Comment 3•5 years ago
|
||
Hello,
The issue can be reproduced on the latest Nightly (71.0a1/20190910213950), Beta (70.0b5/20190909162732) and Release versions (69.0/20190827005903) by following the above STR under Windows 10 Pro 64-bit and macOS High Sierra 10.13.6.
Please note that the mentioned error (InvalidStateError: A mutation operation was attempted on a database that did not allow mutations.
) is also thrown each time a new tab is opened after performing Step 4 and after running browser.storage.local.set({foo:bar})
without setting the mentioned pref (dom.quotaManager.testing
) back to false (as per Step 5).
Comment 4•5 years ago
|
||
I'm not sure it's appropriate to mark any versions of Firefox as affected. The steps to reproduce from comment 0 involve enabling an explicitly test-only pref. It's expected that this breaks everything.
Reporter | ||
Comment 5•5 years ago
|
||
Thanks, we will try Sanitizer.jsm
. Not sure if the bug should be closed as the steps to reproduce seem to be not supported. Feel free to do so if you think that's the case.
Comment 6•5 years ago
|
||
The priority flag is not set for this bug.
:jimm, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•2 years ago
|
Description
•