Closed Bug 1884854 Opened 4 months ago Closed 4 months ago

Simplify urlbar weather fetching

Categories

(Firefox :: Address Bar, task, P3)

task

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: adw, Assigned: adw)

References

Details

(Whiteboard: [sng])

Attachments

(1 file)

Weather fetching is more complicated than it needs to be. There's no reason to allow multiple fetches to hit Merino at once. Instead they should be queued up, with the newest fetch causing older fetches to stop (when possible), similar to how ingest works in the Rust backend.

Context here: https://phabricator.services.mozilla.com/D204138#inline-1130555

This simplifies weather fetching so that multiple fetches are queued up instead
of hitting Merino at the same time. The newest fetch will cause earlier fetches
to stop (when possible). This is similar to how SuggestBackendRust handles
ingest.

This also improves add_tasks_with_rust() in a couple ways: (1) It adds
skip_if_rust_enabled and (2) handles task function args better by cloning them
instead of reusing them in the _rustEnabled and _rustDisabled tasks.

Currently we're relying on the normal xpcshell skip_if predicate to skip
_rustEnabled tasks when Rust is enabled while still running their
_rustDisabled counterparts when Rust is disabled. Except it doesn't work at
all because the skip_if predicate is evaluated at the time add_task() is
called, not when its task runs. That means the _rustDisabled versions of these
tasks are never run, since Rust is now enabled by default. So we're missing test
coverage in these cases. It's not a huge problem since hopefully we will not go
back to enabling the JS backend by default, but until then, we should maintain
test coverage. (The setupAndTeardown() task in test_quicksuggest.js failed
when I fixed this, so that's once case where we had a failing task and didn't
know about it.)

Depends on D204138

Pushed by dwillcoxon@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fc39c4cde378
Simplify urlbar weather fetching and improve add_tasks_with_rust(). r=daisuke
Whiteboard: [sng]
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: