Closed Bug 1848100 Opened 9 months ago Closed 8 months ago

Display the error message when versions for blocked versions on AMO detail pages

Categories

(Fenix :: WebExtensions, defect, P1)

Firefox 118
All
Android

Tracking

(firefox117 wontfix, firefox118 wontfix, firefox119 fixed)

VERIFIED FIXED
119 Branch
Tracking Status
firefox117 --- wontfix
firefox118 --- wontfix
firefox119 --- fixed

People

(Reporter: irusiczki, Assigned: amejia)

References

Details

(Whiteboard: [addons-jira])

Attachments

(8 files)

Attached image AMO detail page

Steps to reproduce

  1. From AMO stage I tried to install addons from the Android collection https://addons.allizom.org/en-US/android/
  2. Some cannot be installed because of the blocklisting

Expected behavior

They should show the error that is displayed by addon manager.

Actual behavior

A continuous transition state of the button.

Device information

  • Firefox version: 118.0
  • Android device model: Pixel
  • Android OS version: 10.0

This is the message shown in addon manager

Whiteboard: [addons-jira]

:amejia could you look into this please? I see two problems here:

  1. the snackbar isn't displayed for a blocklisted add-on installed from AMO (using the mozAddonManager web API)
  2. the error message is truncated, which isn't great
Flags: needinfo?(amejiamarmol)
Assignee: nobody → amejiamarmol
Flags: needinfo?(amejiamarmol)

(In reply to William Durand [:willdurand] from comment #2)

:amejia could you look into this please? I see two problems here:

  1. the snackbar isn't displayed for a blocklisted add-on installed from AMO (using the mozAddonManager web API)
  2. the error message is truncated, which isn't great

Sure, I'll take a look!

  1. the error message is truncated, which isn't great

Maybe we should switch from the snackBar to a dialog where we will have more space, and time for users to read the whole message, wdyt? Normally snackBars are use for showing short messages.

Flags: needinfo?(wdurand)
Priority: -- → P1

Arturo, do you mind adding a severity to the ticket? :)

Flags: needinfo?(amejiamarmol)
Severity: -- → S3
Flags: needinfo?(amejiamarmol)

Sure, I added it :)

the snackbar isn't displayed for a blocklisted add-on installed from AMO (using the mozAddonManager web API)

As now we enabled the mozAddonManager in Fenix, the whole installation flow is handled by it, we are not getting the calls into the Fenix interceptor.

On Android.

We are getting the installation call in amWebAPI.sys.mjs#54 which is aware of the blocklisted error but not handled.

2023-08-10 15:01:40.711 24875-25086 Web Content             org.mozilla.fenix.debug              E  [JavaScript Error: "Got install event for unknown install 2" {file: "resource://gre/modules/amWebAPI.sys.mjs" line: 56}]
                                                                                                    receiveMessage@resource://gre/modules/amWebAPI.sys.mjs:56:21
2023-08-10 15:01:40.712 24875-25086 Web Content             org.mozilla.fenix.debug              E  [JavaScript Error: "Got install event for unknown install 2" {file: "resource://gre/modules/amWebAPI.sys.mjs" line: 56}]
                                                                                                    receiveMessage@resource://gre/modules/amWebAPI.sys.mjs:56:21

Value of this._installMap

Object { window: Window, broker: {…}, id: 0, state: "STATE_CANCELLED", error: "ERROR_BLOCKLISTED", progress: 10677, maxProgress: 10677, event: "onDownloadCancelled", … }

On desktop.

We have different path which handles and shows an error message:

browser-addons.js#75 and browser-addons.js#903.

No sure, how we should surface the error? Should we show a native error? If so we will need add new listeners to capture the errors from the mozAddonManager

Attached image amo_blockedlisted.png

Also noticed the AMO website is not aware of the error and shows a infinite loading state in a the button.

  1. the snackbar isn't displayed for a blocklisted add-on installed from AMO (using the mozAddonManager web API)

Put a patch for addressing 1), I think having a dialog is more user friendly than using a snackbar as this is a security messages which we want users to read carefully, it' is challenging with the snackbar, which doesn't provide a lot of space and disappears in X amount of seconds, even if the user didn't have time to read.

(In reply to Arturo Mejia [:amejia] from comment #9)

  1. the snackbar isn't displayed for a blocklisted add-on installed from AMO (using the mozAddonManager web API)

Put a patch for addressing 1), I think having a dialog is more user friendly than using a snackbar as this is a security messages which we want users to read carefully, it' is challenging with the snackbar, which doesn't provide a lot of space and disappears in X amount of seconds, even if the user didn't have time to read.

Yeah, there were discussions about doing that but no final decision yet. In any case, this should be done for all install errors, so I filed Bug 1848297 for that.

Flags: needinfo?(wdurand)

(In reply to Arturo Mejia [:amejia] from comment #6)

the snackbar isn't displayed for a blocklisted add-on installed from AMO (using the mozAddonManager web API)

As now we enabled the mozAddonManager in Fenix, the whole installation flow is handled by it, we are not getting the calls into the Fenix interceptor.

On Android.

We are getting the installation call in amWebAPI.sys.mjs#54 which is aware of the blocklisted error but not handled.

2023-08-10 15:01:40.711 24875-25086 Web Content             org.mozilla.fenix.debug              E  [JavaScript Error: "Got install event for unknown install 2" {file: "resource://gre/modules/amWebAPI.sys.mjs" line: 56}]
                                                                                                    receiveMessage@resource://gre/modules/amWebAPI.sys.mjs:56:21
2023-08-10 15:01:40.712 24875-25086 Web Content             org.mozilla.fenix.debug              E  [JavaScript Error: "Got install event for unknown install 2" {file: "resource://gre/modules/amWebAPI.sys.mjs" line: 56}]
                                                                                                    receiveMessage@resource://gre/modules/amWebAPI.sys.mjs:56:21

Value of this._installMap

Object { window: Window, broker: {…}, id: 0, state: "STATE_CANCELLED", error: "ERROR_BLOCKLISTED", progress: 10677, maxProgress: 10677, event: "onDownloadCancelled", … }

On desktop.

We have different path which handles and shows an error message:

browser-addons.js#75 and browser-addons.js#903.

No sure, how we should surface the error? Should we show a native error? If so we will need add new listeners to capture the errors from the mozAddonManager

I think we'll need to listen to the addon-install-failed topic somewhere in GeckoViewWebExtension, and from there, we call some delegate (method), e.g. onAddonInstallFailed(). When Fenix receives the event, it should show a snackbar dialog.

With that being said, most of the errors seem to be about edge cases users won't be able to trigger on their own. For instance, AMO cannot show blocked add-ons, except when we start mixing envs like here (in comment 0, it's mentioned that the AMO stage env is used). Maybe we could use this opportunity (i.e. this bug) to implement the topic observer + delegate/method for the future, though. I think most errors in browser-addons.js#75 won't apply for GA.

Attachment #9349331 - Attachment description: WIP: Bug 1848100 - Expose Add-on installation failed listener. → Bug 1848100 - Expose Add-on installation failed listener.
Attachment #9349331 - Attachment description: Bug 1848100 - Expose Add-on installation failed listener. → WIP: Bug 1848100 - Expose Add-on installation failed listener.
Attachment #9349331 - Attachment description: WIP: Bug 1848100 - Expose Add-on installation failed listener. → Bug 1848100 - Expose Add-on installation failed listener.
Pushed by amejiamarmol@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/92f30d583815
Expose Add-on installation failed listener. r=willdurand,geckoview-reviewers,zmckenney
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
See Also: → 1848297
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 118 Branch → 119 Branch
Status: REOPENED → RESOLVED
Closed: 8 months ago8 months ago
Flags: qe-verify+
Resolution: --- → FIXED

As the patch landed on main , it is ready for QA verification :)

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

The patch has landed and therefore it should be closed. QA will mark is as Verified when it's verified.

Status: REOPENED → RESOLVED
Closed: 8 months ago8 months ago
Resolution: --- → FIXED
See Also: → 1852967
Attached image fixed.png

This is verified on AMO stage with Fenix 119.0a1

Status: RESOLVED → VERIFIED
Flags: qe-verify+

R-B failures

https://github.com/mozilla-mobile/reference-browser/runs/16802374648

https://console.firebase.google.com/project/moz-reference-browser-230023/testlab/histories/bh.b4e77beaed81bc1c/matrices/5835589972889365275

  • removeAddonTest
androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: view.getId() is <2131296694/org.mozilla.reference.browser.debug:id/mozac_browser_toolbar_menu>

View Hierarchy:
+>DecorView{id=-1, visibility=VISIBLE, width=1080, height=599, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params={(0,0)(fillxwrap) gr=BOTTOM CENTER_VERTICAL sim={adjust=pan} ty=APPLICATION fmt=TRANSPARENT wanim=0x10302ff
  fl=DIM_BEHIND SPLIT_TOUCH HARDWARE_ACCELERATED
  fitTypes=STATUS_BARS NAVIGATION_BARS CAPTION_BAR}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1} 
|
+->FrameLayout{id=-1, visibility=VISIBLE, width=1080, height=599, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2} 
|
+-->FrameLayout{id=16908290, res-name=content, visibility=VISIBLE, width=1080, height=599, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1} 
|
+--->RelativeLayout{id=-1, visibility=VISIBLE, width=1080, height=599, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=6} 
|
+---->AppCompatImageView{id=2131296580, res-name=icon, visibility=VISIBLE, width=84, height=84, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=42.0, y=42.0} 
|
+---->AppCompatTextView{id=2131296986, res-name=title, visibility=VISIBLE, width=917, height=117, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=134.0, y=42.0, text=uBlock Origin has been added to Reference Browser, input-type=0, ime-target=false, has-links=false} 
|
+---->AppCompatTextView{id=2131296475, res-name=description, visibility=VISIBLE, width=342, height=62, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=134.0, y=201.0, text=Open it in the menu, input-type=0, ime-target=false, has-links=false} 
|
+---->AppCompatImageView{id=-1, visibility=VISIBLE, width=63, height=63, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=476.0, y=201.0} 
|
+---->AppCompatCheckBox{id=2131296355, res-name=allow_in_private_browsing, visibility=VISIBLE, width=522, height=84, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=true, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=134.0, y=305.0, text=Allow in private browsing, input-type=0, ime-target=true, has-links=false, is-checked=false} 
|
+---->AppCompatButton{id=2131296435, res-name=confirm_button, visibility=VISIBLE, width=291, height=126, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=747.0, y=431.0, text=Okay, Got it, input-type=0, ime-target=false, has-links=false} 
|
+-->ViewStub{id=16908719, res-name=action_mode_bar_stub, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0} 
The complete view hierarchy is available in artifact file 'view-hierarchy-2.txt'.
	at androidx.test.espresso.NoMatchingViewException$Builder.build(NoMatchingViewException.java:5)
	at androidx.test.espresso.base.DefaultFailureHandler.lambda$getNoMatchingViewExceptionTruncater$0(DefaultFailureHandler.java:5)
	at androidx.test.espresso.base.DefaultFailureHandler$$ExternalSyntheticLambda1.truncateExceptionMessage(Unknown Source:2)
	at androidx.test.espresso.base.ViewHierarchyExceptionHandler.handleSafely(ViewHierarchyExceptionHandler.java:5)
	at androidx.test.espresso.base.ViewHierarchyExceptionHandler.handleSafely(ViewHierarchyExceptionHandler.java:1)
	at androidx.test.espresso.base.DefaultFailureHandler$TypedFailureHandler.handle(DefaultFailureHandler.java:4)
	at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:5)
	at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:8)
	at androidx.test.espresso.ViewInteraction.desugaredPerform(ViewInteraction.java:11)
	at androidx.test.espresso.ViewInteraction.perform(ViewInteraction.java:8)
	at org.mozilla.reference.browser.helpers.ViewInteractionKt.click(ViewInteraction.kt:11)
	at org.mozilla.reference.browser.ui.robots.NavigationToolbarRobot$Transition.openThreeDotMenu(NavigationToolbarRobot.kt:60)
	at org.mozilla.reference.browser.ui.AddonsTest.removeAddonTest(AddonsTest.kt:97)
  • verifyAddonElementsTest
androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: view.getId() is <2131296694/org.mozilla.reference.browser.debug:id/mozac_browser_toolbar_menu>

View Hierarchy:
+>DecorView{id=-1, visibility=VISIBLE, width=1080, height=599, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params={(0,0)(fillxwrap) gr=BOTTOM CENTER_VERTICAL sim={adjust=pan} ty=APPLICATION fmt=TRANSPARENT wanim=0x10302ff
  fl=DIM_BEHIND SPLIT_TOUCH HARDWARE_ACCELERATED
  fitTypes=STATUS_BARS NAVIGATION_BARS CAPTION_BAR}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1} 
|
+->FrameLayout{id=-1, visibility=VISIBLE, width=1080, height=599, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2} 
|
+-->FrameLayout{id=16908290, res-name=content, visibility=VISIBLE, width=1080, height=599, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1} 
|
+--->RelativeLayout{id=-1, visibility=VISIBLE, width=1080, height=599, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=6} 
|
+---->AppCompatImageView{id=2131296580, res-name=icon, visibility=VISIBLE, width=84, height=84, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=42.0, y=42.0} 
|
+---->AppCompatTextView{id=2131296986, res-name=title, visibility=VISIBLE, width=917, height=117, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=134.0, y=42.0, text=uBlock Origin has been added to Reference Browser, input-type=0, ime-target=false, has-links=false} 
|
+---->AppCompatTextView{id=2131296475, res-name=description, visibility=VISIBLE, width=342, height=62, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=134.0, y=201.0, text=Open it in the menu, input-type=0, ime-target=false, has-links=false} 
|
+---->AppCompatImageView{id=-1, visibility=VISIBLE, width=63, height=63, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=476.0, y=201.0} 
|
+---->AppCompatCheckBox{id=2131296355, res-name=allow_in_private_browsing, visibility=VISIBLE, width=522, height=84, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=true, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=134.0, y=305.0, text=Allow in private browsing, input-type=0, ime-target=true, has-links=false, is-checked=false} 
|
+---->AppCompatButton{id=2131296435, res-name=confirm_button, visibility=VISIBLE, width=291, height=126, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=true, is-layout-requested=false, is-selected=false, layout-params=android.widget.RelativeLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=747.0, y=431.0, text=Okay, Got it, input-type=0, ime-target=false, has-links=false} 
|
+-->ViewStub{id=16908719, res-name=action_mode_bar_stub, visibility=GONE, width=0, height=0, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=true, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0} 
The complete view hierarchy is available in artifact file 'view-hierarchy-2.txt'.
	at androidx.test.espresso.NoMatchingViewException$Builder.build(NoMatchingViewException.java:5)
	at androidx.test.espresso.base.DefaultFailureHandler.lambda$getNoMatchingViewExceptionTruncater$0(DefaultFailureHandler.java:5)
	at androidx.test.espresso.base.DefaultFailureHandler$$ExternalSyntheticLambda1.truncateExceptionMessage(Unknown Source:2)
	at androidx.test.espresso.base.ViewHierarchyExceptionHandler.handleSafely(ViewHierarchyExceptionHandler.java:5)
	at androidx.test.espresso.base.ViewHierarchyExceptionHandler.handleSafely(ViewHierarchyExceptionHandler.java:1)
	at androidx.test.espresso.base.DefaultFailureHandler$TypedFailureHandler.handle(DefaultFailureHandler.java:4)
	at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:5)
	at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:8)
	at androidx.test.espresso.ViewInteraction.desugaredPerform(ViewInteraction.java:11)
	at androidx.test.espresso.ViewInteraction.perform(ViewInteraction.java:8)
	at org.mozilla.reference.browser.helpers.ViewInteractionKt.click(ViewInteraction.kt:11)
	at org.mozilla.reference.browser.ui.robots.NavigationToolbarRobot$Transition.openThreeDotMenu(NavigationToolbarRobot.kt:60)
	at org.mozilla.reference.browser.ui.AddonsTest.verifyAddonElementsTest(AddonsTest.kt:80)

:aaronmt just to be sure, these failures have been fixed by https://github.com/mozilla-mobile/reference-browser/pull/2474, right?

Flags: needinfo?(aaron.train)

LGTM, thanks!

Flags: needinfo?(aaron.train)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: