Closed Bug 1944964 Opened 10 months ago Closed 8 months ago

[Search Consolidation] Modify the BundledSearchEnginesStorage class to call SearchEngineSelector API and utilize it's results.

Categories

(Firefox for Android :: Search, task)

All
Android
task

Tracking

()

RESOLVED FIXED
139 Branch
Tracking Status
firefox139 --- fixed

People

(Reporter: skhan, Assigned: harrisono)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][group3][search-consolidation])

Attachments

(1 file, 3 obsolete files)

Task : Update the BundledSearchEnginesStorage class, specifically add a new function similar to the load function to take in a SearchUserEnvironment as input. This will involve creating a SearchUserEnvironment inside this method and using the SearchEngineSelector API to get search engine data. Will also involve adding subsequent function calls.
Cuurently the load function is designed to use list.json.

Something like

override suspend fun load(
   region: RegionState,
   locale: Locale,
   distribution: String?,
   searchExtraParams: SearchExtraParams?,
   coroutineContext: CoroutineContext,
): SearchMiddleware.BundleStorage.Bundle = withContext(coroutineContext) {
   val searchUserEnvironment = SearchUserEnvironment(
       locale = locale.toString(),
       region = region.toString(),
       update_channel = SearchUpdateChannel.Default,
       distribution_id = distribution ?: "",
       experiment = "", // Assuming empty or from parameters
       app_name = SearchApplicationName.Firefox,
       version = "" // Assuming empty or from parameters
   )

   // Call the SearchEngineSelector API with the created environment
   val refinedSearchConfig = SearchEngineSelector.filterEngineConfiguration(searchUserEnvironment)
   // Process refinedSearchConfig further...
}

The SearchEngineSelector API is defined here : https://github.com/mozilla/application-services/blob/39404c8d2a284aadde38a0e638a4d7b557aa55a8/components/search/src/selector.rs#L57

Note: This seems to be the most likely place according to me where the API needs to get called and results need to be utilized. But will discuss with [:zmckenney] and [:hoglesby] and confirm if we are taking this route.

Summary: [Search Consolidation] Modify the BundledSearchEngineStorage class to accept SearchUserEnvironment. → [Search Consolidation] Modify the BundledSearchEngineStorage class to call SearchEngineSelector API and utilize it's results.
Summary: [Search Consolidation] Modify the BundledSearchEngineStorage class to call SearchEngineSelector API and utilize it's results. → [Search Consolidation] Modify the BundledSearchEnginesStorage class to call SearchEngineSelector API and utilize it's results.
Depends on: 190035
Depends on: 1930035
No longer depends on: 190035

This task is dependent on how we plan to call the API.
SPIKE for that is bug 1945638

Depends on: 1945638
Assignee: nobody → hoglesby
Status: NEW → ASSIGNED

Closed the Spike bug 1945638. Unblocks this task.

Blocks: 1954785
Blocks: 1954786
No longer blocks: 1954786

Something we agreed upon in slack

From harrisono
11:58 AM
Hey Sarah,
I’m starting to get back onto the ticket to call SearchEngineSelector and I’m wondering if I should change the direction of this a bit.
I’m thinking that maybe instead of modifying BundledSearchEngineStorage to read from SearchEngineSelector, I should make a new “SearchEngineStorage” to read from SearchEngineSelector and add it to SearchMiddleware.
This way we can still keep the old BundledSearchEngineStorage in case of problems and we can roll this new search engine paradigm out as an experiment/staged rollout. I think you already have a ticket for something like this.
Also I think that this work would be on top of this PR https://phabricator.services.mozilla.com/D238063 so I’ll build on top of it.

Attachment #9470109 - Attachment is obsolete: true
Blocks: 1956861
Blocks: 1957744
Attached file Bug 1944964 - [WIP] add icons (obsolete) —

WIP DO NOT LAND AS IS

Attachment #9478422 - Attachment is obsolete: true
Blocks: 1961270
Pushed by hoglesby@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6d14ef918676 Add SearchEngineSelectorRepository to SearchMiddleware r=android-reviewers,skhan
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 139 Branch
Regressions: 1963954
Attachment #9479515 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: