Closed Bug 1828966 Opened 1 years ago Closed 1 years ago

Pin to Toolbar context menu item is sometimes out of sync

Categories

(WebExtensions :: General, defect, P3)

defect

Tracking

(firefox114 fixed)

RESOLVED FIXED
114 Branch
Tracking Status
firefox114 --- fixed

People

(Reporter: mconley, Assigned: willdurand)

References

Details

(Whiteboard: [addons-jira])

Attachments

(2 files)

STR:

  1. Install two WebExtensions that have browser actions. I'm using uBlock Origin and Firefox Relay.
  2. Pin one of the browser actions to the toolbar
  3. Shrink the browser window down so that both browser actions appear in the addons panel
  4. Open the addons panel
  5. Right-click on the browser action that was overflowed from the toolbar. The context menu should show "Pin to Toolbar" in the checked state.
  6. Right-click on the browser action that was already living in the panel and was never in the toolbar.

ER:

The context menu item for "Pin to Toolbar" for the second item should be in the unchecked state.

AR:

The menu item is in the checked state at first. A subsequent context click puts it in the unchecked state. I think there's some kind of race here.

The attached video shows the behaviour for both items in the panel - there seems to be a race for both of them.

Severity: -- → S4
Priority: -- → P3
Whiteboard: [addons-jira]

I could only reproduce on macOS but it is indeed a valid bug. I noticed
that moving the await code at the bottom of the function fixed it but
that didn't sound too great.

I decided to propose this patch instead, and I made sure that we
wouldn't hit a similar problem with the "disabled" state of the remove
button. Apparently, that still works as expected (on macOS).

I am not quite sure how to cover that with a test, though, because we
have test coverage for the attributes and the HTML markup is correctly
updated. For example, I could see the correct checked attribute in the
HTML (in the devtools) with the wrong context menu item state rendered,
sigh. This likely means the race is at a lower level (cocoa?).

Assignee: nobody → wdurand
Status: NEW → ASSIGNED
Pushed by wdurand@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/123d6c05b43f Ensure Pin to Toolbar context menu item shows the correct state when opening the context menu. r=mconley
Status: ASSIGNED → RESOLVED
Closed: 1 years ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: