-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Bugfix FXIOS-14056 [Trending Searches] google trending url #30479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🧹 Tidy commitJust 1 file(s) touched. Thanks for keeping it clean and review-friendly! 💬 Description craftsmanGreat PR description! Reviewers salute you 🫡 ✅ Per-file coverageAll changed files meet the threshold of 35.0%. Client.app: Coverage: 37.15
Generated by 🚫 Danger Swift against 1297c13 |
| let trendingTemplate = convertASSearchURLToOpenSearchURL( | ||
| engine.urls.trending, | ||
| for: engine, | ||
| overrideSearchArg: false | ||
| ) ?? "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cyndichin If we're always wanting this behavior for trending URLs, why are we having to override this on the client. Shouldn't this be fixed in the source data (on Remote Settings)? Apologies if I'm misunderstanding or missing something obvious. 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for calling this out @mattreaganmozilla !!
Summarizing what we discussed on slack:
why are we having to override this on the client.
We get this configuration from remote settings:
Optional<SearchEngineUrl>
▿ some : SearchEngineUrl
- base : "https://www.google.com/complete/search"
- method : "GET"
▿ params : 2 elements
▿ 0 : SearchUrlParam
- name : "client"
▿ value : Optional<String>
- some : "firefox"
- enterpriseValue : nil
- experimentConfig : nil
▿ 1 : SearchUrlParam
- name : "channel"
▿ value : Optional<String>
- some : "ftr"
- enterpriseValue : nil
- experimentConfig : nil
▿ searchTermParamName : Optional<String>
- some : "q"
- displayName : nil
- isNewUntil : nil
- excludePartnerCodeFromTelemetry : false
- acceptedContentTypes : nil
However, on our side we are parsing the details and formatting into a url via convertASSearchURLToOpenSearchURL. It seems that for our searchTermParamName we are always appending {searchTerms}, but we don't want to do that for trending searches. Therefore, we added an override here.
For trending searches, we want the following url - https://www.google.com/complete/search?client=firefox&channel=ftr&q=
Shouldn't this be fixed in the source data (on Remote Settings)?
We discussed that maybe it makes more sense to not have q under searchTermParamName and instead maybe have it under base or param. Pinged Mark on the consolidated search channel and will wait to hear back on this before proceeding next steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Cyndi for documenting this 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So instead of trying to parse the URL differently from remote settings, it was recommended that we should still pass through {searchTerms}, which for the other urls should be replaced by the actual search term. However, for trending searches should be the empty string q=. Updated PR with this commit: 1297c13
6307aa5 to
1297c13
Compare
| func trendingURLForEngine() -> URL? { | ||
| guard let trendingTemplate else { return nil } | ||
| return URL(string: trendingTemplate) | ||
| return getURLFromTemplate(trendingTemplate, query: "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
|
🚀 PR merged to |
📜 Tickets
Jira ticket
Github issue
💡 Description
The trending url for google was only showing a list of terms related to search terms and not the actual trending searches. We should be using
/complete/search?q=&client=firefox&channel=ftrinstead. Added an override booloverrideSearchArgto avoid appending searchTerms to the search query argument.🎥 Demos
📝 Checklist