No notification for blocked add-on denied installation on Android
Categories
(Firefox for Android :: WebExtensions, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox115 | --- | unaffected |
| firefox116 | --- | wontfix |
| firefox117 | --- | verified |
People
(Reporter: acornestean, Assigned: willdurand)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [addons-jira])
Attachments
(2 external files, 1 obsolete file)
Affected versions:
Beta 116.0b6 (Build #2015962691), ebbc0eaf46+ // GV: 116.0-20230716180334 // AS: 116.0
Description:
Attempting to install a blocked add-on will not show the notification in the UI for the failed installation.
Steps to reproduce:
- With network enabled, attempt to install a blocked add-on
- Notice the add-on will not be installed, as expected, however the UI notification for the failed action will not be displayed
Actual:
The notification in the UI for failing to install a blocked add-on is not shown.
Expected:
The notification in the UI for failing to install a blocked add-on should be shown.
| Reporter | ||
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Arturo/Rob, is this on someone's radar?
| Assignee | ||
Comment 2•3 years ago
|
||
This is a bug in Fenix that was caused by Bug 1842916.
Comment 3•3 years ago
|
||
Set release status flags based on info from the regressing bug 1842916
:amejia, since you are the author of the regressor, bug 1842916, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 4•3 years ago
•
|
||
When Gecko sends to GV in WebExtension.java here there is a check for 2 states: STATE_POSTPONED and STATE_CANCELLED. A blocked install and a user cancelled are both considered STATE_CANCELLED which means they're now filtered out.
The reason it sends cancelled is because we call install.cancel() when the extension is disabled (blocked) here which then sends here and calls the STATE_CANCELLED.
Somehow we will need to separate user cancelled and blocked states. I think we will need to add another state to AddonManager.sys.mjs for STATE_BLOCKED with code 13 which we'll filter separately in GV.
Comment 5•3 years ago
|
||
Comment 6•3 years ago
|
||
Updated•3 years ago
|
Comment 7•3 years ago
|
||
The root cause of the issue here is that the patch for bug 1842916 makes the incorrect assumption that STATE_CANCELLED + error 0 is user-canceled. The currently proposed patch tries to special-case "blocklist state", but still keeps the incorrect assumption.
I propose to fix the bug as follows:
- IF you want to keep the concept of "user cancelled":
- Revert the patch from bug 1842916, at least the part that translates STATE_CANCELED to STATE_USER_CANCELED at https://searchfox.org/mozilla-central/rev/ea65de7c7b01ce5e7b2c0d2b6684ce0219cc2914/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebExtension.java#1592-1593
- Detect user cancellation in
ExtensionPromptObserver'spromptPermissionmethod, and set the necessary flags, so that ultimately the "user canceled" state can be picked up byExtensionInstallListener
- If you want to have meaningful user notification instead of a generic error (probably needed anyway for bug 1844557):
- Update AddonManager to always set
install.errorto a meaningful error when blocked. To know where to change stuff, see below. - To emphasize if it is not clear: the correct approach is to set
install.errorcorrectly, not to invent a newinstall.state.
- Update AddonManager to always set
Another install failure that happens that also has STATE_CANCELLED + error 0 is when an add-on is marked as incompatible with the current Firefox version. In terms of flow through code, that happens like this:
- After downloading the add-on, appDisabled is set to
falsebecause the add-on is incompatible (there are many other potential causes including blocklisted, but recall that we're examining the scenario of the add-on being incompatible).- Source:
AddonInstall'sloadManifestat https://searchfox.org/mozilla-central/rev/ea65de7c7b01ce5e7b2c0d2b6684ce0219cc2914/toolkit/mozapps/extensions/internal/XPIInstall.jsm#1652 isUsableAddondetermines the value ofappDisabled; it does a lot more than just checking the blocklist/compat state- Source: https://searchfox.org/mozilla-central/rev/ea65de7c7b01ce5e7b2c0d2b6684ce0219cc2914/toolkit/mozapps/extensions/internal/XPIDatabase.jsm#2515-2599
- For example,
isUsableAddonalso checks the signed state. But GeckoView wouldn't examine the appDisabled flag because a more specific error (ERROR_SIGNEDSTATE_REQUIRED) is emitted before GV is notified.
- Source:
- An update check happens, but that doesn't find a new compatible add-on:
- Source:
DownloadAddonInstall'sonStopRequestat https://searchfox.org/mozilla-central/rev/ea65de7c7b01ce5e7b2c0d2b6684ce0219cc2914/toolkit/mozapps/extensions/internal/XPIInstall.jsm#2542,2544,2550
- Source:
- Nothing interesting happens before notifying external callees of the incompatibility:
- Source:
AddonInstall'sdownloadCompletedat https://searchfox.org/mozilla-central/rev/ea65de7c7b01ce5e7b2c0d2b6684ce0219cc2914/toolkit/mozapps/extensions/internal/XPIInstall.jsm#2606-2637- Side note: this code also shows that the blocklist state of the add-on is updated when needed (in case the add-on was updated during step 2).
- Source:
- The install is flagged as canceled.
- Source: https://searchfox.org/mozilla-central/rev/ea65de7c7b01ce5e7b2c0d2b6684ce0219cc2914/toolkit/mozapps/extensions/AddonManager.sys.mjs#2194-2198
- Side note: you can also see the "addon-install-failed" notification there, which is used by desktop to hook up an UI notification about the failure, which is handled at https://searchfox.org/mozilla-central/rev/ea65de7c7b01ce5e7b2c0d2b6684ce0219cc2914/browser/base/content/browser-addons.js#858-929
- An interesting note here: desktop generally relies on
install.errorto derive the message for the failure, except when blocklisted or incompatible. In that case, the status is computed through theaddon.blocklistState(and assuming that the other failure reason is incompatibility).- Source: https://searchfox.org/mozilla-central/rev/ea65de7c7b01ce5e7b2c0d2b6684ce0219cc2914/browser/base/content/browser-addons.js#898-910
- The most clean approach is probably to introduce a specific error state for blocklisted (and incompatibility), and update the code linked here, as well as the definition of
ERROR_L10N_IDSto map the error to the string.
- Source: https://searchfox.org/mozilla-central/rev/ea65de7c7b01ce5e7b2c0d2b6684ce0219cc2914/toolkit/mozapps/extensions/AddonManager.sys.mjs#2194-2198
| Assignee | ||
Comment 8•3 years ago
|
||
Updated•3 years ago
|
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 10•3 years ago
|
||
| bugherder | ||
| Reporter | ||
Comment 11•3 years ago
|
||
Verified as Fixed. Tested on the latest Nightly 117.0a1 for Android (Build #2015965411), f75286d4aa+ // GV: 117.0a1-20230730210800 // AS: 117.20230729050233
When attempting to install a blocked add-on, the “Failed to install [add-on_name]” notification is now successfully displayed.
Comment 12•3 years ago
|
||
:willdurand is this okay to ride the trains with 117? or were you planning on nominating this for a 116 dot release?
| Assignee | ||
Comment 13•3 years ago
|
||
It's fine to let it ride the trains with 117, no need to uplift anything.
Updated•3 years ago
|
Updated•3 years ago
|
Description
•