Closed
Bug 1206741
Opened 9 years ago
Closed 9 years ago
[OTA update] Unable to effectively change the update URL
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(blocking-b2g:2.5+, firefox44 fixed)
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: janx, Assigned: janx)
References
Details
Attachments
(2 files, 3 obsolete files)
3.53 KB,
patch
|
janx
:
review+
gerard-majax
:
feedback+
|
Details | Diff | Splinter Review |
3.24 KB,
patch
|
Details | Diff | Splinter Review |
(See bug 1201556 comment 36.)
Assignee | ||
Comment 1•9 years ago
|
||
Untested.
Assignee | ||
Comment 2•9 years ago
|
||
That's solution 1 from the other bug, to err on the side of caution.
Assignee | ||
Comment 3•9 years ago
|
||
Tested and fixed.
Attachment #8665069 -
Attachment is obsolete: true
Assignee | ||
Comment 4•9 years ago
|
||
Comment on attachment 8665437 [details] [diff] [review] [OTA] Make URL pref changes overwrite B2G's setting. Alex, I chose to implement option 1 anyway, because it seems safer to me. For example, imagine that someone changes the update URL in order to switch to a community-managed OTA server, but for some reason the phone needs to be rebooted before an update can be received (bad network reception, battery is empty... anything really). It's just more practical to keep the setting unchanged, until the underlying pref changes, instead of resetting it on every reboot.
Attachment #8665437 -
Flags: feedback?(lissyx+mozillians)
Comment 5•9 years ago
|
||
How do I reset if I want to go back to default values ?
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8665437 [details] [diff] [review] [OTA] Make URL pref changes overwrite B2G's setting. Fabrice, I've had to modify the behavior of my update URL setting somewhat in order to support FOTA updates for foxfood devices. In short, the setting will now watch for changes to the underlying pref, and reset itself to the new value if there is a change (e.g. when an OTA update modifies the update URL format). More details about the change can be found in bug 1201556 comment 36 (I chose to go with solution 1).
Attachment #8665437 -
Flags: review?(fabrice)
Comment 7•9 years ago
|
||
Comment on attachment 8665437 [details] [diff] [review] [OTA] Make URL pref changes overwrite B2G's setting. Review of attachment 8665437 [details] [diff] [review]: ----------------------------------------------------------------- That would look good, but I would feel better if we could find a way to cover this by tests: it is the kind of stuff we really don't want to break. Breakage here might equal no more updates. ::: b2g/chrome/content/settings.js @@ +317,5 @@ > + // changes the update URL format. > + let backupName = prefName + '.old'; > + try { > + let backupValue = Services.prefs.getCharPref(backupName); > + if (defaultValue !== backupValue) { And everything relies on this comparison: when pushing a new Gecko that changes app.update.url or app.update.channel, that will get triggered. @@ +319,5 @@ > + try { > + let backupValue = Services.prefs.getCharPref(backupName); > + if (defaultValue !== backupValue) { > + // If the pref has changed since our last backup, overwrite the setting. > + navigator.mozSettings.createLock().set(defaultSetting); So we initialize the setting here. @@ +320,5 @@ > + let backupValue = Services.prefs.getCharPref(backupName); > + if (defaultValue !== backupValue) { > + // If the pref has changed since our last backup, overwrite the setting. > + navigator.mozSettings.createLock().set(defaultSetting); > + Services.prefs.setCharPref(backupName, defaultValue); And we initialize backup. @@ +336,3 @@ > return; > } > + defaultBranch.setCharPref(prefName, value); And here we will overwrite the pref defined by the setting value.
Attachment #8665437 -
Flags: feedback?(lissyx+mozillians) → feedback+
Comment 8•9 years ago
|
||
Comment on attachment 8665437 [details] [diff] [review] [OTA] Make URL pref changes overwrite B2G's setting. Review of attachment 8665437 [details] [diff] [review]: ----------------------------------------------------------------- ::: b2g/chrome/content/settings.js @@ +324,5 @@ > + Services.prefs.setCharPref(backupName, defaultValue); > + } > + } catch(e) { > + // If there was no backup, create one. > + Services.prefs.setCharPref(backupName, defaultValue); You do the same thing here and in the try {} block. You can just move that after the catch {}
Attachment #8665437 -
Flags: review?(fabrice) → review+
Assignee | ||
Comment 9•9 years ago
|
||
Rebased and included comments from comment 7, keeping Fabrice's r+.
Attachment #8665437 -
Attachment is obsolete: true
Attachment #8667249 -
Flags: review+
Assignee | ||
Comment 10•9 years ago
|
||
Last-minute tweak on Alex's request: If there is no backup value, overwrite the setting (so that the backup-creating patch doesn't have to be applied *before* the pref changes).
Attachment #8667249 -
Attachment is obsolete: true
Attachment #8667255 -
Flags: review+
Assignee | ||
Comment 11•9 years ago
|
||
Quick-and-dirty patch for Alex to add debugging logs to the code.
Comment 12•9 years ago
|
||
Comment on attachment 8667255 [details] [diff] [review] [OTA] Make URL pref changes overwrite B2G's setting. Review of attachment 8667255 [details] [diff] [review]: ----------------------------------------------------------------- I checked several workflows: (1) landing app.update.url AND this patch at the same time (2) landing app.update.url before this patch (3) landing app.update.url after this patch Results are: (1) works well, the new pref value is properly used to perform update checking (2) first boot with only app.update.url change, the pref is not considered and we still use the old value from setting. second boot after adding this patch, we do the update query against the new update url (3) first boot with only this patch, update checking is performed against the old url as expected. second boot after changing the update url pref, is uses the new update url value So it would look to be working as expected and in all cases it should be good to land this with bug 1201556 attachment 8662338 [details] [diff] [review]
Attachment #8667255 -
Flags: feedback+
Assignee | ||
Comment 13•9 years ago
|
||
I didn't find an easy way to test this update-pref/setting sync glue, so let's use bug 1209503 to investigate further, and land this FOTA-unblocking fix in the meantime.
Assignee | ||
Updated•9 years ago
|
Assignee | ||
Comment 14•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=3bb573cd0440
Updated•9 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 17•9 years ago
|
||
Thanks for setting "checkin-needed", I meant to do it right after the try results were green. OK to land.
Flags: needinfo?(janx)
Comment 18•9 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/9be12cdd5daf
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/9be12cdd5daf
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S9 (16Oct)
You need to log in
before you can comment on or make changes to this bug.
Description
•