Closed Bug 1035807 Opened 10 years ago Closed 9 years ago
[b2g] unable to override app
.update .url in settings developer menu
Currently the b2g developer panel in settings provides an "Update URL" text box. Setting this value creates an entry like this in the user profile prefs.js: user_pref("app.update.url", "https://aus4.mozilla.org/update/3/B2G/%VERSION%/20140704000201/flame/%LOCALE%/%CHANNEL%/%OS_VERSION%/default/default/update.xml"); Note that I have overridden the PRODUCT_VERSION here to be flame. I want to use flame OTA updates on my open c device which does not have its own update channel. In logcat, however, I see that the original URL is actually used: I/Gecko ( 301): *** AUS:SVC Checker:getUpdateURL - update URL: https://aus4.mozilla.org/update/3/B2G/32.0a2/20140703000248/ZTE_P821A10/en-US/aurora/Boot2Gecko%18.104.22.168-prerelease/default/default/update.xml?force=1 As you can see it still uses ZTE_P821A10 for the PRODUCT_VERSION. I tried rebooting in case the pref was cached, but that had no effect. This code suggests that maybe gaia should set app.update.url.override instead of app.update.url: http://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/update/nsUpdateService.js#3595
Janx, this is a bug I already talked about :)
Assignee: nobody → janx
`app.update.url.override` is used more than I imagined, so it needs to be controllable from the settings: - Either instead of `app.update.url`, - Or as an additional `Override` field.
Ben, "app.update.url.override" should only be used for tests. Do you have a way to find out if/where that pref is being set? I'm not sure we want to expose it in the Settings, because it should really only be used for tests, and not make the "app.update.url" pref obsolete. However, if the override really is being used badly and we can't fix it, I guess we won't have a choice.  http://dxr.mozilla.org/mozilla-central/source/browser/app/profile/firefox.js#140
Jan, I'm not really sure the right way to fix this. I just want to be able to change my update URL so I can have my Open C pull flame OTA updates.
Might have to expose the override field then. Self-needinfo so I don't forget about this.
So Fabrice ran into this as well. If you have any information that could help me debug this, please share. - Supposedly, the app.update.url and app.update.channel prefs are successfully controlled by the UI in Gaia's Developer menu. - However, sometimes update requests as seen in logcat seem to ignore these prefs. - This could be due to someone using the app.update.url.override pref (my attached patches allow to control it, but it's a test-only pref so I don't like people changing it for no reason). - This could be due to something else designed to illegitimately bypass our update process.  http://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/update/nsUpdateService.js#3613  http://dxr.mozilla.org/mozilla-central/source/browser/app/profile/firefox.js#140
What I did is: - flash a v184 image. - upgrade to current 2.2 using a pvt build. At the point the DEVICE is set to flame-kk by v184 which is bogus. - I updated the url in the setting app, replacing %DEVICE% by 'flame' - doing a forced update check, flame-kk is still used in the AUS url.
I'm not sure how to debug this. On my Keon, when I use Settings > Device Information > Check Now, for some reason I see  being logged but never  or , and nothing else ever happens. I'd be very interested to see what happens to `url` in getUpdateURL, and what code paths it goes through. If someone can please add some logging there to watch the construction of the update url, that'd be great.  http://dxr.mozilla.org/mozilla-central/source/b2g/chrome/content/shell.js#723  http://dxr.mozilla.org/mozilla-central/source/b2g/components/UpdatePrompt.js#416  http://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/update/nsUpdateService.js#3654  http://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/update/nsUpdateService.js#3609
Are you sure you have builds that are good ? e.g., VARIANT=userdebug and B2G_UPDATER=1 ?
fwiw, adding *another* field for the override url will be a usability nightmare. There should be just an update channel and url fields, and do whatever magic it takes to get things working.
I agree about the usability problems of another field, and forgot about userdebug and B2G_UPDATER. I'll follow up, thanks!
Hmm, it turns out that the update service uses default pref values for app.update.url and app.update.channel, ignoring any user changes to prefs.  http://dxr.mozilla.org/mozilla-central/source/toolkit/mozapps/update/nsUpdateService.js#3618  http://dxr.mozilla.org/mozilla-central/source/toolkit/modules/UpdateChannel.jsm#26 This is by design, as explained in bug 302721 comment 43 (from 9 years ago), and MozillaZine says app.update.channel's caveat is that you can only change it by editing channel-prefs.js in the application directory.  http://kb.mozillazine.org/App.update.channel For the feature to work, B2G's settings should somehow be able to modify the default values of the app.update.channel and app.update.url prefs.
This fixes the feature for me. Fabrice, please let me know what you think.
Comment on attachment 8509110 [details] [diff] [review] Actually allow overriding app.update.url from FxOS developer menu. Review of attachment 8509110 [details] [diff] [review]: ----------------------------------------------------------------- I guess you tested on device?
Attachment #8509110 - Flags: review?(fabrice) → review+
Thanks! Yes, with VARIANT=userdebug and B2G_UPDATER=1, and it works on my keon. Rebased, carried over. https://tbpl.mozilla.org/?tree=Try&rev=fd48080fac7e
Random breakages look unrelated.
Should we ask for uplift to 2.1?
[Blocking Requested - why for this release]: Update channel and url are presented as editable in 2.1's developer menu, but the feature is non-functional without this patch.
blocking-b2g: --- → 2.1?
I would not ask for blocking, just for b2g-34 approval on the patch.
Ok thanks for the advice, I'll do that.
blocking-b2g: 2.1? → ---
Comment on attachment 8509874 [details] [diff] [review] Actually allow overriding app.update.url from FxOS developer menu. NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings. [Approval Request Comment] Bug caused by (feature/regressing bug #): Feature from bug 984962 doesn't work without this fix. User impact if declined: There are input fields at the bottom of the developer menu letting users think they can modify update url and channel, but it won't work. Testing completed: Verified that it worked on device. Risk to taking this patch (and alternatives if risky): Moderate. It lets the user modify update prefs, but clearing the input fields restores them to default. Alternative would be to remove the feature entirely. String or UUID changes made by this patch: none.
Attachment #8509874 - Flags: approval-mozilla-b2g34?
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S7 (24Oct)
Attachment #8509874 - Flags: approval-mozilla-b2g34? → approval-mozilla-b2g34+
You need to log in before you can comment on or make changes to this bug.