[Search Consolidation] Setup architecture to call the search-config-icons-v2 remote collection through ApplicationServices
Categories
(Firefox for Android :: Search, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox138 | --- | fixed |
People
(Reporter: skhan, Assigned: tchoh)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxdroid][group3][search-consolidation])
Attachments
(2 files, 1 obsolete file)
Search icons API is in a collection here as search-config-icons-v2 : https://firefox.settings.services.mozilla.com/v1/buckets/main/collections/search-config-icons/records
and can be called similar to how search-telemtry-v2 is being fetched here : https://searchfox.org/mozilla-mobile/source/firefox-android/android-components/components/support/remotesettings/src/main/java/mozilla/components/support/remotesettings/RemoteSettingsClient.kt#65
The basic idea here would be to download the search-config-icons-v2 json, have it filtered and then download only the icons relevant to the mobile platform. The filtering uses JEXL: https://remote-settings.readthedocs.io/en/latest/target-filters.html
This is performed client side. I believe the remote settings team have a Rust implementation of either the remote server client or the JEXL filtering.
Zac has more idea here on how to use this filter or may redirect to an appropriate person so need'infoing him.
One of the examples in our app for jexl use is : https://searchfox.org/mozilla-mobile/source/firefox-android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/OnboardingFragment.kt#256
Perhaps we can do this at the start of the app in : https://searchfox.org/mozilla-mobile/source/firefox-android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt#328
Looping in Harrison and Zac for discussion
One another question is do we need to store this json as dump locally?
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
(In reply to [:skhan] from comment #1)
One another question is do we need to store this json as dump locally?
There is no requirement for a dump to be fetched in Android / iOS directly as Application Services will have the initial dump
Add any new collection you want to ship on mobile to Application Services
https://github.com/mozilla/application-services/blob/56307e4fd16b902565e4549d8c5369e19c9d9ef3/components/remote_settings/src/client.rs#L88-L92
Expected new collections:
- search-config-v2
- search-config-icons (has attachments)
Spoke with Mark
interaction with JEXL directly is not required.
When you call make_client on the collection, you'll pass a RemoteSettingsContext object to the make_client call, and then remote settings will do the filtering for you.
This will be handled by https://bugzilla.mozilla.org/show_bug.cgi?id=1947538#c1
where the RemoteSettingsContext will be passed when calling makeClient call.
Since JEXL isnt directly required, I will not be doing that part of the ticket. I will make my patch ready for review.
Hi Tim [:tchoh], let's test out the full functionality here using the steps defined in bug 1947538 i.e.
- Setup
service = RemoteSettingsService
in your class - call
client = service.makeClient(collectionName, Context)
to get the client - To get the records, call
client.getRecords()
Updated•6 months ago
|
Comment 8•5 months ago
|
||
bugherder |
Updated•5 months ago
|
Comment 10•5 months ago
|
||
A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)
Updated•5 months ago
|
Reporter | ||
Comment 11•5 months ago
•
|
||
Notes
- The response from the API looks like
RemoteSettingsRecord( id=d87f251c-3e12-a8bf-e2d0-afd43d36c5f9, lastModified=1741614164947, deleted=false, attachment=Attachment( filename=1und1-16-firefox.gif, mimetype=image/gif, location=main-workspace/search-config-icons/00e78ac9-ea13-408b-8b63-3a0930a1f9ab.gif, hash=865d76c8175a8f11dedc93f0bc212242a97a8a76adac870e8249368cecc81402, size=159 ), fields={ "engineIdentifiers": [ "1und1" ], "imageSize": 16, "schema": 1741613151713 }),
The way to fetch the actual icon is url + location (in API data). The url for different servers being
Reporter | ||
Comment 12•5 months ago
|
||
The Android icons haven't been merged to the remote server collection yet yet. We are using staging server and "main-preview", that too only has desktop icons. So end to end testing will remain until that is completed.
However we have the format how the data will look like so this patch sets up the architecture.
Updated•4 months ago
|
Comment 13•4 months ago
|
||
Comment 14•4 months ago
|
||
bugherder |
Description
•