Open Bug 1876329 Opened 2 years ago Updated 1 year ago

DebuggerDelegate + onExtensionListUpdated results in lost extension state when an extension is installed temporarily

Categories

(GeckoView :: Extensions, defect)

All
Android
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:

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 the AddonManagerDelegate 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.

The severity field is not set for this bug.
:amejia, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(amejiamarmol)

Rob could you help to prioritize this bug by adding the severity field? :)

Flags: needinfo?(amejiamarmol) → needinfo?(rob)
See Also: → 1882622
Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.