Closed Bug 1983376 Opened 7 months ago Closed 7 months ago

Allow features that use dynamic Rust suggestions to be their own SuggestProvider

Categories

(Firefox :: Address Bar, task, P1)

task

Tracking

()

RESOLVED FIXED
144 Branch
Tracking Status
firefox143 --- fixed
firefox144 --- fixed

People

(Reporter: adw, Assigned: adw)

References

(Regressed 1 open bug)

Details

(Whiteboard: [sng])

Attachments

(2 files)

Now that we have two relatively complex uses cases for dynamic Rust suggestions, realtime/carrots opt-in suggestions and important-dates suggestions, it's become clear that trying to handle them both in DynamicSuggestions.sys.mjs is a little messy and constricting.

In general, it would make a lot of sense for features that use dynamic Rust suggestions to be able to be their own proper SuggestProviders just like all others. They'll only use dynamic suggestions under the hood. That way, they can also easily have their own prefs that they're gated behind too, so we don't have to rely on the quicksuggest.dynamicSuggestionTypes pref.

This adds a new getter to SuggestProvider called dynamicRustSuggestionType.
When a feature manages a dynamic Rust suggestion type, its getter should return
the value of the suggestion_type field in their RS records. That will tell
Suggest that it uses dynamic Rust suggestions, and Suggest will keep track of it
separately from the other Rust providers.

Similarly, this adds a new suggestion and result payload property called
secondaryProvider. It's only used for dynamic Rust suggestions and will be set
to suggestion_type too. So when we need to look up the feature that manages a
dynamic Rust suggestion, we use secondaryProvider to connect it to the feature
whose dynamicRustSuggestionType is the same value. It's just like
suggestion.provider except it's one level down.

Pushed by dwillcoxon@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/81cf070e9d06 https://hg.mozilla.org/integration/autoland/rev/953f96cbb3e4 Allow features that use dynamic Rust suggestions to be their own SuggestProvider. r=daisuke
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch

This adds a new getter to SuggestProvider called dynamicRustSuggestionTypes.
When a feature manages a dynamic Rust suggestion type, its getter should return
the values of the suggestion_type field in their RS records. That will tell
Suggest that it uses dynamic Rust suggestions, and Suggest will keep track of it
separately from the other Rust providers.

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

Attachment #9507999 - Flags: approval-mozilla-beta?
Attachment #9507999 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Regressions: 1971091
QA Whiteboard: [search] [qa-triage-done-c144/b143]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: