Closed Bug 1844004 Opened 3 years ago Closed 3 years ago

No notification for blocked add-on denied installation on Android

Categories

(Firefox for Android :: WebExtensions, defect, P1)

Firefox 116
Unspecified
Android
defect

Tracking

()

VERIFIED FIXED
117 Branch
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:

  1. With network enabled, attempt to install a blocked add-on
  2. 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.

Arturo/Rob, is this on someone's radar?

Flags: needinfo?(rob)
Flags: needinfo?(amejiamarmol)

This is a bug in Fenix that was caused by Bug 1842916.

Component: Blocklist Implementation → WebExtensions
Flags: needinfo?(rob)
Flags: needinfo?(amejiamarmol)
Keywords: regression
Product: Toolkit → Fenix
Regressed by: 1842916

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.

Flags: needinfo?(amejiamarmol)
Assignee: nobody → zmckenney
Severity: -- → S3
Priority: -- → P1

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.

Flags: needinfo?(wdurand)
Attachment #9345005 - Attachment description: WIP: Bug 1844004 - Add STATE_BLOCKED for attempted blocked addon install → Bug 1844004 - Add STATE_BLOCKED for attempted blocked addon install

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:

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:

  1. After downloading the add-on, appDisabled is set to false because 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).
  2. An update check happens, but that doesn't find a new compatible add-on:
  3. Nothing interesting happens before notifying external callees of the incompatibility:
  4. The install is flagged as canceled.
Flags: needinfo?(wdurand)
Flags: needinfo?(amejiamarmol)
See Also: → 1844557
Attachment #9345568 - Attachment description: WIP: Bug 1844004 - Only set ERROR_USER_CANCELED when the cancellation originated from the user. r?robwu! → Bug 1844004 - Only set ERROR_USER_CANCELED when the cancellation originated from the user. r?robwu!
Assignee: zmckenney → wdurand
Whiteboard: [addons-jira]
Blocks: 1845745
Pushed by wdurand@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2520d04a87c2 Only set ERROR_USER_CANCELED when the cancellation originated from the user. r=geckoview-reviewers,robwu,owlish
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch

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.

Status: RESOLVED → VERIFIED

:willdurand is this okay to ride the trains with 117? or were you planning on nominating this for a 116 dot release?

Flags: needinfo?(wdurand)

It's fine to let it ride the trains with 117, no need to uplift anything.

Flags: needinfo?(wdurand) → needinfo?(dsmith)
Flags: needinfo?(dsmith)
Attachment #9345005 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: