Switching between localisations of Firefox can end up with the wrong default engine
Categories
(Firefox :: Search, defect, P1)
Tracking
()
People
(Reporter: bkaluzny, Assigned: standard8)
Details
Attachments
(2 files)
|
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
|
36.97 KB,
image/png
|
Details |
From Partner:
When l choose Mozilla Options – General – Language – English
- In this case both search entities – search bar and address bar – Google by default. My Windows set is English. Yet IP address is Moscow, Russia (double checked that).
This should not be happening.
Can we have someone help investigate? I can loop them in with her to see if there are some odd setting issues. Can we add there Yandex search by default, if IP locale is Russian?
| Assignee | ||
Comment 1•5 years ago
|
||
Just in case people are watching this bug.
Yandex is definitely the default for English locales in the Russian (RU) region. We fixed that back in bug 1565315.
I think the issue being seen by the partner is swapping between English and Russian language packs (and hence languages). I'm investigating more at the moment.
| Assignee | ||
Comment 2•5 years ago
•
|
||
I think I've figured this out. STR:
- Create a new profile and create a prefs.js file with the lines: (to preset region and turn modern config off).
user_pref("browser.search.region", "RU");
user_pref("browser.search.modernConfig", false);
- Start up the Russian Firefox locale with Firefox 75.
- Wait 10 seconds, check the list in preferences and restart (this just makes sure that the profile is initialised etc).
- Go to Preferences -> General -> Languages
- Click the Set Alternatives button
- Select "Select a language to add", and add English US
- Select Add, then OK.
- Select Apply and Restart.
- Check the search engine list and the default engine.
Expected Results
=> "Yandex" should be the default.
Actual Results
=> "Google" is the default.
The same also happens if you started up a en-US build with the same profile rather than doing steps 4 to 8.
This also does not apply to the modern search configuration (only enabled on nightly at the moment).
| Assignee | ||
Comment 3•5 years ago
|
||
Technical details:
- When Firefox Russian starts up, we check ABSearch for the default engine. For Russian locale and Russian region, we get "Яндекс" which is the Russian Yandex. The search service stores "Яндекс" as the default engine in the search cache.
- When we then start up with the English version of Firefox the search service kicks in and a few things happen:
_getEngineDefaultsees the user hasn't got a current engine, so tries to get the default engine from the configuration._originalDefaultEngineloads the default name, "Яндекс", from the cache.- It then tries to get the engine, which fails because the Russian version of Yandex isn't available in English builds.
- The code then falls back to getting the first engine in the sorted engine list which in this case happens to be Google.
The modern configuration doesn't have this issue because it doesn't have a separate item it stores in the cache for the default engine.
For now, we should make it so that the legacy configuration falls back to the list.json specified default if it can't find the one saved in the search cache.
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 4•5 years ago
|
||
This helps fix the case when language switching that we get the wrong default engine if the cache is out of date.
Modern is unaffected as it doesn't use ABSearch, but the test covers both to make sure.
Comment 6•5 years ago
|
||
| bugherder | ||
| Assignee | ||
Comment 7•5 years ago
|
||
Comment on attachment 9141070 [details]
Bug 1629680 - When determining the original default engine, fallback to the configuration set engine if the cached engine can't be found. r?daleharvey!
Beta/Release Uplift Approval Request
- User impact if declined: Users may get the wrong/unexpected default search engine if they switch the language that Firefox is using.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: See comment 2
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Only affects the default fallback, has tests.
- String changes made/needed: None
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
Comment 8•5 years ago
|
||
Comment on attachment 9141070 [details]
Bug 1629680 - When determining the original default engine, fallback to the configuration set engine if the cached engine can't be found. r?daleharvey!
Thanks for the new tests. Approved for 76.0b7.
Comment 9•5 years ago
|
||
| bugherder uplift | ||
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Tested under Win 10 and Ubuntu 18.04 64-bit.
I reproduced the initial issue using Firefox 76 beta 6.
On Firefox 76 beta 7 and Nightly 77.0a1 2020-04-21, Yandex remains the default set engine, but the rest of the engines are changed with those from en-US localisation. Please see the attached screenshot.
This is accordingly with the list of search engines we see with Search Helper Addon (see below), but we are wondering if this is expected at this point. Mark, could you please take a look? Thank you!
Search Engine DevTools record for RU region and en-US locale:
Index Id
1 yandex@search.mozilla.org
2 google@search.mozilla.org
3 amazondotcom@search.mozilla.org
4 ddg@search.mozilla.org
5 bing@search.mozilla.org
6 twitter@search.mozilla.org
7 wikipedia@search.mozilla.org
Updated•5 years ago
|
| Assignee | ||
Comment 11•5 years ago
|
||
(In reply to Petruta Rasa from comment #10)
Tested under Win 10 and Ubuntu 18.04 64-bit.
I reproduced the initial issue using Firefox 76 beta 6.
On Firefox 76 beta 7 and Nightly 77.0a1 2020-04-21, Yandex remains the default set engine, but the rest of the engines are changed with those from en-US localisation. Please see the attached screenshot.This is accordingly with the list of search engines we see with Search Helper Addon (see below), but we are wondering if this is expected at this point. Mark, could you please take a look? Thank you!
Yes, that's expected - the user has switched to en-US, so we display the more relevant English based versions of engines. Yandex is still default though which is what we want for someone using en-US in the Russian region.
Comment 12•5 years ago
|
||
Thank you! Marking as verified as per above comments.
As a side note, for Nightly I added the en-US .xpi after I switched the preference intl.multilingual.enabled to True.
Description
•