Closed Bug 1629680 Opened 5 years ago Closed 5 years ago

Switching between localisations of Firefox can end up with the wrong default engine

Categories

(Firefox :: Search, defect, P1)

75 Branch
Desktop
Unspecified
defect
Points:
3

Tracking

()

VERIFIED FIXED
Firefox 77
Iteration:
77.1 - Apr 6 - Apr 19
Tracking Status
firefox75 --- wontfix
firefox76 --- verified
firefox77 --- verified

People

(Reporter: bkaluzny, Assigned: standard8)

Details

Attachments

(2 files)

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?

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.

I think I've figured this out. STR:

  1. 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);
  1. Start up the Russian Firefox locale with Firefox 75.
  2. Wait 10 seconds, check the list in preferences and restart (this just makes sure that the profile is initialised etc).
  3. Go to Preferences -> General -> Languages
  4. Click the Set Alternatives button
  5. Select "Select a language to add", and add English US
  6. Select Add, then OK.
  7. Select Apply and Restart.
  8. 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).

Summary: When local = Russia, search default should be Yandex. Currrently it is Google. → Switching between localisations of Firefox can end up with the wrong default engine

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:
  • _getEngineDefault sees the user hasn't got a current engine, so tries to get the default engine from the configuration.
  • _originalDefaultEngine loads 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.

Group: mozilla-employee-confidential
Iteration: --- → 77.1 - Apr 6 - Apr 19
Points: --- → 3

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.

Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1a260a167df1 When determining the original default engine, fallback to the configuration set engine if the cached engine can't be found. r=daleharvey
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED

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
Attachment #9141070 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Target Milestone: Firefox 76 → Firefox 77

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.

Attachment #9141070 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

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

Flags: needinfo?(standard8)

(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.

Flags: needinfo?(standard8)

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.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: