Closed Bug 1925235 Opened 5 months ago Closed 2 months ago

Searchmode defaults to Google after browser restart

Categories

(Firefox :: Address Bar, defect, P3)

Desktop
All
defect

Tracking

()

VERIFIED FIXED
136 Branch
Tracking Status
firefox133 --- disabled
firefox135 --- verified
firefox136 --- verified

People

(Reporter: oardelean, Assigned: yazan)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [sng])

Attachments

(3 files, 3 obsolete files)

Attached video bug.mov

Notes

  • Reproducible when entering searchmode for Bookmarks, Tabs, Actions and History options.

Found in

  • Nightly 133.0a1;

Affected versions

  • Nightly 133.0a1;

Affected platforms

  • Ubuntu 22;
  • macOS 14;
  • Windows 10;

Preconditions

  • Have browser.urlbar.scotchBonnet.enableOverride set to true
  • Have browser.urlbar.searchRestrictKeywords.featureGate set to true

Steps to reproduce

  1. Launch Firefox and open a new tab.
  2. From the Dedicated Search Button select Bookmarks.
  3. Restart Firefox.
  4. Observe the address bar.

Expected result

  • Searchmode is enabled for Bookmarks.

Actual result

  • Searchmode is enabled for Google.

Regression range

  • Not a regression.
Severity: -- → S3
Priority: -- → P3
Whiteboard: [sng]
Assignee: nobody → yalmacki
Attachment #9435410 - Attachment is obsolete: true
Attachment #9436896 - Attachment is obsolete: true
Attachment #9445421 - Attachment description: Bug 1925235 - Prevent #updateSearchIcon from running concurrently. r?daleharvey,#urlbar-reviewers → Bug 1925235 - Terminate #updateSearchIcon call if search mode switches during its execution to prevent icon from incorrectly switching. r?daleharvey
Attachment #9445421 - Attachment description: Bug 1925235 - Terminate #updateSearchIcon call if search mode switches during its execution to prevent icon from incorrectly switching. r?daleharvey → Bug 1925235 - Terminate #updateSearchIcon call if search mode switches during its execution to prevent unified search button icon from incorrectly switching. r?daleharvey
Attachment #9445421 - Attachment description: Bug 1925235 - Terminate #updateSearchIcon call if search mode switches during its execution to prevent unified search button icon from incorrectly switching. r?daleharvey → Bug 1925235 - Prevent #updateSearchIcon from running concurrently. r?daleharvey,#urlbar-reviewers
Attachment #9445421 - Attachment description: Bug 1925235 - Prevent #updateSearchIcon from running concurrently. r?daleharvey,#urlbar-reviewers → Bug 1925235 - Avoid updating unified search button icon if searchMode has changed. r?daleharvey
Pushed by yalmacki@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f05807fed9ba Avoid updating unified search button icon if searchMode has changed. r=daleharvey,sessionstore-reviewers,dao
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch

Currently, multiple calls to #updateSearchIcon can run concurrently. When restarting the browser with a tab , and another tab in which a local search mode is active, the local search mode is incorrectly displayed as the default engine search mode. I believe this is due to the first #updateSearchIcon call (default engine, triggered when new tab is reopened) taking longer than the subsequent #updateSearchIcon call (triggered when the search mode is restored).

This is probably due to [[ https://searchfox.org/mozilla-central/rev/b6718bf263ae780289da471f0ea35797a09e2f05/browser/components/urlbar/SearchModeSwitcher.sys.mjs#329-334 | this ]] code taking a while to execute in comparison to [[ https://searchfox.org/mozilla-central/rev/b6718bf263ae780289da471f0ea35797a09e2f05/browser/components/urlbar/SearchModeSwitcher.sys.mjs#338-342 | this ]] code that runs for local search modes.

Ensuring that an #updateSearchIcon call terminates if search mode switches during its async processing prevents it from interfering with the next call triggered and incorrectly overriding the icon.

Original Revision: https://phabricator.services.mozilla.com/D233036

Attachment #9459538 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: Users could see incorrect search mode icon when restarting browser, causing confusion
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Open a 2nd tab on browser and change search mode to bookmarks (with scotch bonnnet enabled). Restart the browser and observe search mode icon/label. It should display bookmarks.
  • Risk associated with taking this patch: Low
  • Explanation of risk level: Patch avoids updating icon when search mode changes during the update call. It's a very small fix so the risk is low.
  • String changes made/needed: N/A
  • Is Android affected?: no
Flags: qe-verify+

Currently, multiple calls to #updateSearchIcon can run concurrently. When restarting the browser with a tab , and another tab in which a local search mode is active, the local search mode is incorrectly displayed as the default engine search mode. I believe this is due to the first #updateSearchIcon call (default engine, triggered when new tab is reopened) taking longer than the subsequent #updateSearchIcon call (triggered when the search mode is restored).

This is probably due to [[ https://searchfox.org/mozilla-central/rev/b6718bf263ae780289da471f0ea35797a09e2f05/browser/components/urlbar/SearchModeSwitcher.sys.mjs#329-334 | this ]] code taking a while to execute in comparison to [[ https://searchfox.org/mozilla-central/rev/b6718bf263ae780289da471f0ea35797a09e2f05/browser/components/urlbar/SearchModeSwitcher.sys.mjs#338-342 | this ]] code that runs for local search modes.

Ensuring that an #updateSearchIcon call terminates if search mode switches during its async processing prevents it from interfering with the next call triggered and incorrectly overriding the icon.

Original Revision: https://phabricator.services.mozilla.com/D233036

Attachment #9459546 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: Users could see incorrect search mode icon when restarting browser, causing confusion
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Open a 2nd tab on browser and change search mode to bookmarks (with scotch bonnnet enabled). Restart the browser and observe search mode icon/label. It should display bookmarks.
  • Risk associated with taking this patch: Low
  • Explanation of risk level: Patch avoids updating icon when search mode changes during the update call. It's a very small fix so the risk is low.
  • String changes made/needed: N/A
  • Is Android affected?: no
Attachment #9459538 - Attachment is obsolete: true
Attachment #9459538 - Flags: approval-mozilla-beta?
Flags: in-testsuite+
Attachment #9459546 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Reproducible on a 2024-10-17 Nightly build on Windows 10.
Verified as fixed on Firefox Nightly 136.0a1 and Firefox 135.0b6 ( treeherder build) on Windows 10, Ubuntu 22, macOS 14.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: