Flush prefs on handling a locale change event

RESOLVED FIXED in Firefox 32

Status

()

Firefox for Android
Locale switching and selection
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: rnewman, Assigned: rnewman)

Tracking

32 Branch
Firefox 33
All
Android
Points:
---

Firefox Tracking Flags

(firefox32 fixed, firefox33 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Just in case Gecko doesn't. We should add

  Services.prefs.savePrefFile(null);

to browser.js, around line 1637.
(Assignee)

Comment 1

3 years ago
Created attachment 8437418 [details] [diff] [review]
Flush prefs on handling a locale change event. v1
Attachment #8437418 - Flags: review?(mark.finkle)
(Assignee)

Updated

3 years ago
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Comment on attachment 8437418 [details] [diff] [review]
Flush prefs on handling a locale change event. v1

If we need to, we need to. Looks like we need to.

But keep bug 683808 in mind.
(Assignee)

Comment 3

3 years ago
This is only called when you actively select a new locale, so it shouldn't affect any fast paths.

We want this to be as close to a synchronous persistent prefs write as possible, because we only tell Gecko the new locale once. I've seen rapid hard quits on a low-end device lose the 'written' pref, which is a bad experience -- you have to switch locales again to get the change to stick.
Attachment #8437418 - Flags: review?(mark.finkle) → review+
(Assignee)

Comment 4

3 years ago
https://hg.mozilla.org/integration/fx-team/rev/f2213f0c8362
status-firefox32: --- → affected
status-firefox33: --- → fixed
Flags: needinfo?(rnewman)
(Assignee)

Comment 5

3 years ago
Comment on attachment 8437418 [details] [diff] [review]
Flush prefs on handling a locale change event. v1

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
  Robustness improvement for Bug 917480.

User impact if declined: 
  Certain edge cases (e.g., OOM shortly after changing locale) can result in mixed locales between Gecko and Java.

Testing completed (on m-c, etc.): 
  Tested locally, landed and waiting for screams.

Risk to taking this patch (and alternatives if risky): 
  Approximately zero. Flushing the prefs file might cause stalls, but this is a very infrequent user action.

String or IDL/UUID changes made by this patch:
  None.
Attachment #8437418 - Flags: approval-mozilla-aurora?
Flags: needinfo?(rnewman)
https://hg.mozilla.org/mozilla-central/rev/f2213f0c8362
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 33
Comment on attachment 8437418 [details] [diff] [review]
Flush prefs on handling a locale change event. v1

Aurora approval granted.
Attachment #8437418 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
https://hg.mozilla.org/releases/mozilla-aurora/rev/beb8b71d7b9a
status-firefox32: affected → fixed
You need to log in before you can comment on or make changes to this bug.