Closed Bug 1619710 Opened 5 years ago Closed 5 years ago

GeckoView is not notifying back after allowing to update an extension that requires new permissions

Categories

(GeckoView :: Extensions, defect)

defect
Not set
normal

Tracking

(firefox75 fixed)

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: amejia, Assigned: bdahl)

Details

Attachments

(1 file)

Steps to reproduce

  1. Install an extension you could use UBlock 1.24.4 (The latest version at the moment is 1.25.0)
  2. Call webExtensionController.update(ublock)
  3. As the new version requires new permissions you will get a subsequent call to onUpdatePrompt, to indicate that we want to proceed with the update return AllowOrDeny.ALLOW

Expected behaviour

When the update is completed we get a call on the GeckoResult<WebExtension> of webExtensionController.update(ublock), indicating the status of the update.

Actual behaviour

We never get a callback on webExtensionController.update(ublock), as a result the consumer doesn't know in which state is the update.

Agi,
As mentioned in #gv-webext room, the update is hanging because it requires a browser restart to become active (bug 1279012). I'm thinking we can add onInstallPostponed callback to the ExtensionInstallListener and reject the install with a new error code. Thoughts?

Flags: needinfo?(agi)

That sounds good. Either that or just returning null from update (i.e. no update is present)

Flags: needinfo?(agi)
Assignee: nobody → bdahl

An extension with an onUpdateAvailable listener should delay automatic
updating of the extension until the app is restarted. Add support for this
state and reject the update result with a new install error code.

(In reply to Brendan Dahl [:bdahl] from comment #3)

Created attachment 9130625 [details]
Bug 1619710 - Handle postponed web extension updates in GeckoView. r=#geckoview-reviewers

An extension with an onUpdateAvailable listener should delay automatic
updating of the extension until the app is restarted. Add support for this
state and reject the update result with a new install error code.

Brendan just to clarify, the new behaviour will be the gecko result is going be rejected and we are going to get an error indicating the app needs to be restarted? If this is the new behaviour is looks like a bit drastic from the user perspective, that just updated an add-on. Is it possible to perform the update without the need of restarting?

Flags: needinfo?(bdahl)

That's correct, the promise will be rejected with WebExtension.InstallException.ErrorCodes.ERROR_POSTPONED. I don't think we can change the behavior here though as it's how the extension expects it to work. This is how firefox and chrome desktop work as well. See bug 1279012.

Flags: needinfo?(bdahl)
Pushed by bdahl@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1787aa14e3ec Handle postponed web extension updates in GeckoView. r=geckoview-reviewers,agi
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: