-
Notifications
You must be signed in to change notification settings - Fork 1.3k
3869 fix default search engine #6197
3869 fix default search engine #6197
Conversation
d553ab8
to
0bd9262
Compare
Codecov Report
@@ Coverage Diff @@
## master #6197 +/- ##
===========================================
- Coverage 16.48% 16.4% -0.08%
+ Complexity 353 352 -1
===========================================
Files 276 276
Lines 11146 11206 +60
Branches 1602 1608 +6
===========================================
+ Hits 1837 1838 +1
- Misses 9155 9214 +59
Partials 154 154
Continue to review full report at Codecov.
|
} | ||
code.set(defaultEngine.identifier) | ||
name.set(defaultEngine.name) | ||
submissionUrl.set(defaultEngine.buildSearchUrl("")) |
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.
As far as I can tell, these properties are only used to send this ping, so making this async shouldn't change any behavior.
9cf35b1
to
719fb2c
Compare
* | ||
* Cache hits/misses are reported to telemetry. | ||
*/ | ||
private fun getCurrentSearchEngine(context: Context): SearchEngine { |
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.
See commit message for an explanation as to why this approach was taken.
89df622
to
16708f3
Compare
.getDefaultSearchEngine(context) | ||
|
||
val cacheWasHit = selectedSearchEngine != null | ||
Events.searchFragmentCacheAccess.set(cacheWasHit) |
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.
This is the first time I've added a new ping, would you please double check that I'm doing it properly?
@boek data review Request for data collection review form
|
fe17b33
to
b217723
Compare
SearchEngineManager now provides the default search engine when no name param is passed
See mozilla-mobile#3869 (comment) for an explanation of why
Alternatives to this approach that I tried: Approach: make searchEngineSource & defaultEngineSource nullable, launch an async call in onCreateView, and update them when possible. Problems: a lot of code relies on these states always being available. In particular, I was concerned that this could introduce problems into some of our telemetry. Approach: make EngineSource an argument to SearchFragment. Retrieve it before launching SearchFragment Problems: SearchFragment can be started via intent. Taking this approach would hurt our cold startup time in that instance, which is a critical performance area. This also spread complex coroutine code across a lot of the codebase.
b217723
to
d20cfd7
Compare
@@ -154,6 +154,16 @@ events: | |||
notification_emails: | |||
- fenix-core@mozilla.com | |||
expires: "2020-03-01" | |||
search_fragment_cache_access: |
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.
Could you fill out the data request form for 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.
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.
I'm a dummy, don't know how I missed it!
NOTE: this does not close #3869, which is still blocked on getting an API key. This completes the prework so we will be able to just swap the key in and close.
Pull Request checklist
No user facing changes
No user facing changes
After merge
To download an APK when reviewing a PR: