Closed Bug 1930646 Opened 12 days ago Closed 10 days ago

The Address Bar drop down flickers when the weather keywords are typed or deleted

Categories

(Firefox :: Address Bar, defect, P1)

Desktop
All
defect

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox133 --- disabled
firefox134 --- fixed

People

(Reporter: cfat, Assigned: adw)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

[Affected versions]:

  • Firefox Beta 133.0b7 (Build ID: 20241111092015)

[Affected Platforms]:

  • Windows 10 x64
  • Ubuntu 20.04 x64
  • macOS 12.6.1

[Prerequisites]:

  • Have the Firefox Beta 133 en-* build installed.
  • Set browser.search.region pref to US. (mandatory use of a VPN client if non-US user).
  • Windows ONLY: Set browser.urlbar.weather.ignoreVPN pref to true.
  • Set browser.urlbar.weather.featureGate pref to true.
  • Set browser.urlbar.suggest.quicksuggest.sponsored pref to true.
  • Set browser.urlbar.suggest.weather pref to true.
  • Have the OS language set to English (US).

[Steps to reproduce]:

  1. Open the browser with the profile from prerequisites.
  2. Type “la ca weather” keyword in the Address Bar.
  3. Delete a few characters.
  4. Observe the behavior.

[Expected result]:

  • The Address Bar drop down doesn’t flicker.

[Actual result]:

  • The Address Bar drop down flickers each time a new character is typed or deleted.

[Notes]:

See Also: → 1853111
OS: Unspecified → All
Hardware: Unspecified → Desktop

Thanks Carmen. This is probably due to latency of fetching the suggestion from Merino. I can sometimes reproduce it but it's never this bad for me. If we cache the Merino response during the urlbar session, as you're typing the city's name character by character, that should fix it.

Assignee: nobody → adw
Status: NEW → ASSIGNED
Priority: -- → P1

This adds some simplistic caching for weather suggestions, just like we have
simplistic caching for geolocation. That fixes the bug by avoiding latency when
calling Merino while you're typing a long query that keeps matching the same
suggestion again and again.

Instead of duplicating the caching logic from geolocation, I moved it into
MerinoClient so that both geolocation and weather can use it, and potentially
other features in the future.

Since caching interferes with tests that don't expect it, I added a simple way
to disable it during tests. MerinoTestUtils sets a static property on
MerinoClient called _test_disableCache. I added a test that specifically
tests the cache so we can be sure it works right.

Depends on D228755

Pushed by dwillcoxon@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8ce955d96ebd Add a simplistic caching mechanism to MerinoClient to avoid weather suggestions flicker. r=daisuke
Status: ASSIGNED → RESOLVED
Closed: 10 days ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch

The patch landed in nightly and beta is affected.
:adw, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox133 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(adw)

I tried to verify this issue on the latest Firefox Nightly 134.0a1 (Build ID 20241115093447) on Windows 10, macOS 12.6.1, and Ubuntu 20.04 x64, but I can still see the Address Bar flickering intermittently.

  • The patch did improve the overall experience, but I am still able to reproduce it occasionally (please see the video).

Not sure if this might be related, but please keep in mind that I need to connect to a VPN in order to trigger the weather suggestion (I’ve reproduced this with 2 different VPN clients).

Drew, could you please take a look at this?

Hmm thanks. I'm not sure what the problem is. I'll clone this bug since it's not totally fixed, but first, could you set browser.urlbar.loglevel to Debug, trigger the problem a few times by typing "ny ny weather", open the browser console and filter on weather, and post the output here?

Flags: needinfo?(adw)

Sure thing. The weather logs are in this Gdoc. Let me know if you need any other information.

Flags: needinfo?(adw)

Thanks Carmen. I'm hoping bug 1931811, which speeds up matching, also helped. It was a fix to the Rust component, which I vendored in to mozilla-central in bug 1932496, which just landed on mozilla-central. Once bug 1932496 is in Nightly (might take another day), could you try reproducing this again please?

The log is kind of strange because it shows this being logged again and again:

QuickSuggest.SuggestBackendRust: Adding type to query: 'Weather'

But in most cases there's no Handling query or Tokenizer: Tokenizing search string "ny ny weather" messages before that, which there should be. It almost seems like a copy-paste error or something. Aside from that, the log pretty much looks like what I'd expect and confirms this bug's fix is working as intended.

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

Attachment

General

Created:
Updated:
Size: