Persistent state and prefs (e.g. extensions.webextensions.uuids) from generated test extensions are not cleaned up at extension.unload()
Categories
(WebExtensions :: General, defect, P2)
Tracking
(firefox127 fixed)
Tracking | Status | |
---|---|---|
firefox127 | --- | fixed |
People
(Reporter: robwu, Assigned: robwu)
References
(Blocks 1 open bug)
Details
(Whiteboard: [addons-jira])
Attachments
(1 file)
Ordinarily (outside of tests), when an extension is uninstalled, any remaining state is cleaned up in ExtensionAddonObserver.onUninstalled
. This is triggered by the AddonManager internals.
In tests, when ExtensionTestUtils.loadExtension
is used without useAddonManager
, a bare Extension
instance is created without the AddonManager. Consequently, the cleanup logic never runs. As a result, persistent state is never cleaned up:
extensions.webextensions.uuids
will continuously accumulate values for every new extension (bug 1363464).
This is particularly problematic in mochitests, because eventually a ceiling will be reached on the permitted length of the pref value, e.g.: https://bugzilla.mozilla.org/show_bug.cgi?id=1611913#c1- ExtensionPermissions is not cleared.
- Extension API state is not cleaned up (storage API, scripting API, DNR API).
- DOM state (cache, storage, permissions, service workers)
This can easily be observed when you run a mochitest with the --compare-preferences
flag, as shown in https://bugzilla.mozilla.org/show_bug.cgi?id=1825953#c5 . This flag is enabled by default on TV builds.
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Comment 2•2 years ago
|
||
The severity field is not set for this bug.
:willdurand, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Comment 3•2 years ago
|
||
The severity field is not set for this bug.
:rpl, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•2 years ago
|
Updated•2 years ago
|
Comment 4•7 months ago
|
||
There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:robwu, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
Assignee | ||
Updated•6 months ago
|
Description
•