Closed Bug 1877300 Opened 5 months ago Closed 5 months ago

Teach the Rust component about the weather trigger keywords

Categories

(Application Services :: Suggest, task)

task

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lina, Assigned: adw)

References

Details

(Whiteboard: [disco])

For weather suggestions, we store all the keywords that should trigger a call to Merino's AccuWeather provider in a single weather record. The Rust component currently ignores this record; however, Desktop's weather provider relies on it, and so this bug blocks Desktop from switching over to the Rust component backend for Quick Suggest. This bug tracks teaching the Rust component about that record.

The weather record looks like this (check out https://firefox.settings.services.mozilla.com/v1/buckets/main/collections/quicksuggest/records/weather for the latest):

{
   "type": "weather",
   "schema": 1683294047906,
   "weather": {
      "keywords": [
         "weather",
         "forecast",
         "windy",
         "humidity",
         "monsoon",
         "flooding",
         "rain in",
         "storms",
         "storm in",
         "forcast",
         "wether",
         "wather",
         "weahter",
         "weater",
         "weaher",
         "vindy"
      ],
      "min_keyword_length": 3,
      "min_keyword_length_cap": 6
   },
   "id": "weather",
   "last_modified": 1683313881574
}

Since this record is so small, and read all at once, it could make sense to store this configuration in the meta table.

For exposing the weather keywords to clients, I could see us having a more generic configuration interface, like:

[Enum]
interface SuggestionProviderConfig {
  Weather(sequence<string> keywords, i32 min_keyword_length, i32 min_keyword_length_cap);
};

interface SuggestStore {
  [Throws=SuggestApiError]
  SuggestionProviderConfig? fetch_configuration(SuggestionProvider provider);
};

Alternatively, we could have a method specifically for fetching weather configuration:

dictionary SuggestWeatherConfig {
  sequence<string> keywords;
  i32 min_keyword_length;
  i32 min_keyword_length_cap;
};

interface SuggestStore {
  [Throws=SuggestApiError]
  SuggestWeatherConfig? fetch_weather_config();
};
Blocks: 1877306

Drew volunteered to take this in our check-in meeting. Thanks!

Assignee: nobody → adw

For exposing the weather keywords to clients, I could see us having a more generic configuration interface, like:

Drew also pointed out that we have frequency caps (in the firefox-suggest-configuration record), so a generic configuration interface sounds like it'll make a lot of sense. We can get another bug on file to add that.

Status: NEW → RESOLVED
Closed: 5 months ago
OS: macOS → All
Hardware: x86_64 → All
Resolution: --- → FIXED
Blocks: 1878441
You need to log in before you can comment on or make changes to this bug.