DebuggerDelegate + onExtensionListUpdated results in lost extension state when an extension is installed temporarily
Categories
(GeckoView :: Extensions, defect)
Tracking
(Not tracked)
People
(Reporter: robwu, Unassigned, NeedInfo)
References
Details
The DebuggerDelegate
interface + onExtensionListUpdated
method was introduced in order to detect add-ons that have been added through the devtools/debugger protocol to Gecko.
The actual implementation of the interface basically wipes the list of previously known extensions, and resets the set of extensions with the newly retrieved set of extensions:
- Android-Components : https://searchfox.org/mozilla-mobile/rev/063c6bcf58858b26ebdc8cd0c8f2c658d82061da/firefox-android/android-components/components/support/webextensions/src/main/java/mozilla/components/support/webextensions/WebExtensionSupport.kt#335-339
- TestRunnerActivity (used by mochitests): https://searchfox.org/mozilla-central/rev/961556b584938a694d7df6e7bf25d70253c37060/mobile/android/test_runner/src/main/java/org/mozilla/geckoview/test_runner/TestRunnerActivity.java#607-614
- TestRunner (used by xpcshell tests): https://searchfox.org/mozilla-central/rev/961556b584938a694d7df6e7bf25d70253c37060/mobile/android/test_runner/src/main/java/org/mozilla/geckoview/test_runner/XpcshellTestRunnerService.java#112-119
The problem with this is that the installation/uninstallation of any unrelated extension results in the state of all other extensions being discarded. Bug 1876317 shows the impact on unit tests (with a concrete failure reported in bug 1875948).
There are two ways to fix this problem:
- Change
list()
in GeckoView and A-C to re-use previous extension instances, or to copy over previous state if existent. Gecko/GeckoView needs to forward an opaque identifier to enable GeckoView/A-C to detect whether the extension has been reloaded (if so, then previous state should be ignored). - Change
DebuggerDelegate
usage to only update the installed/uninstalled add-on (instead of listing all add-ons). - Drop the
DebuggerDelegate
and use theAddonManagerDelegate
that has been enriched with events in bug 1826739.
At this point, due to the complete Addon lifecycle coverage by AddonManagerDelegate
, I would recommend to drop DebuggerDelegate
and rely on AddonManagerDelegate
to detect temporary add-ons.
Comment 1•2 years ago
|
||
The severity field is not set for this bug.
:amejia, could you have a look please?
For more information, please visit BugBot documentation.
Comment 2•2 years ago
|
||
Rob could you help to prioritize this bug by adding the severity field? :)
Updated•1 year ago
|
Description
•