Last Comment Bug 759460 - Preprocess channel name into nsUpdateService.js instead of just using 'default'
: Preprocess channel name into nsUpdateService.js instead of just using 'default'
Status: RESOLVED FIXED
:
Product: Toolkit
Classification: Components
Component: Application Update (show other bugs)
: 15 Branch
: All All
: -- normal (vote)
: mozilla14
Assigned To: Robert Strong [:rstrong] (use needinfo to contact me)
:
Mentors:
Depends on:
Blocks: 657789
  Show dependency treegraph
 
Reported: 2012-05-29 12:27 PDT by Robert Strong [:rstrong] (use needinfo to contact me)
Modified: 2012-06-03 22:23 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
-
fixed
-
fixed


Attachments
patch rev1 - preprocess the channel name into nsUpdateService.js (1.55 KB, patch)
2012-05-29 12:42 PDT, Robert Strong [:rstrong] (use needinfo to contact me)
netzen: review+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Robert Strong [:rstrong] (use needinfo to contact me) 2012-05-29 12:27:41 PDT
To help mitigate problems with the channel name defined in the channel-prefs.js file I would like to change the channel name 'default' used in nsUpdateService.js to be the channel name defined during the build.

Patch coming up
Comment 1 Robert Strong [:rstrong] (use needinfo to contact me) 2012-05-29 12:28:59 PDT
This will also mitigate issues where the channel-prefs.js file disappears for whatever reason.
Comment 2 Robert Strong [:rstrong] (use needinfo to contact me) 2012-05-29 12:30:04 PDT
btw: this WILL NOT remove the channel-prefs.js file and the channel defined in channel-prefs.js will take precedence over this value.
Comment 3 Robert Strong [:rstrong] (use needinfo to contact me) 2012-05-29 12:42:56 PDT
Created attachment 628067 [details] [diff] [review]
patch rev1 - preprocess the channel name into nsUpdateService.js
Comment 4 Brian R. Bondy [:bbondy] 2012-05-29 13:11:24 PDT
Comment on attachment 628067 [details] [diff] [review]
patch rev1 - preprocess the channel name into nsUpdateService.js

Review of attachment 628067 [details] [diff] [review]:
-----------------------------------------------------------------

function Update(update) {
  this._properties = {};
  this._patches = [];
  this.isCompleteUpdate = false;
  this.showPrompt = false;
  this.showSurvey = false;
  this.showNeverForVersion = false;
?  this.channel = "default"


Does the line denoted with ? need to be updated to use this pref as well?
Comment 5 Robert Strong [:rstrong] (use needinfo to contact me) 2012-05-29 14:40:10 PDT
(In reply to Brian R. Bondy [:bbondy] from comment #4)
> Comment on attachment 628067 [details] [diff] [review]
> patch rev1 - preprocess the channel name into nsUpdateService.js
> 
> Review of attachment 628067 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> function Update(update) {
>   this._properties = {};
>   this._patches = [];
>   this.isCompleteUpdate = false;
>   this.showPrompt = false;
>   this.showSurvey = false;
>   this.showNeverForVersion = false;
> ?  this.channel = "default"
> 
> 
> Does the line denoted with ? need to be updated to use this pref as well?
It gets set from the update itself so it doesn't have to be set here.
http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/update/nsUpdateService.js#2566
Comment 6 Brian R. Bondy [:bbondy] 2012-05-29 16:27:51 PDT
sounds good, thanks
Comment 7 Robert Strong [:rstrong] (use needinfo to contact me) 2012-05-30 15:19:35 PDT
Pushed to mozilla-inbound
https://hg.mozilla.org/integration/mozilla-inbound/rev/3a8bfbf6d2f6
Comment 8 Ed Morley [:emorley] 2012-05-31 05:58:04 PDT
https://hg.mozilla.org/mozilla-central/rev/3a8bfbf6d2f6
Comment 9 Robert Strong [:rstrong] (use needinfo to contact me) 2012-05-31 09:45:24 PDT
Comment on attachment 628067 [details] [diff] [review]
patch rev1 - preprocess the channel name into nsUpdateService.js

[Approval Request Comment]
Bug caused by (feature/regressing bug #): This is a mitigation for Bug 746156 and Bug 756325
User impact if declined: Likely none. This handles the case where if the channel-prefs.js file which contains the channel name disappears the channel name will still be correct.
Testing completed (on m-c, etc.): Visual inspection of files in the build.
Risk to taking this patch (and alternatives if risky): Minimal.
String or UUID changes made by this patch: None
Comment 10 Robert Strong [:rstrong] (use needinfo to contact me) 2012-06-01 12:26:55 PDT
To verify this:
1. install a nightly build with the fix that has an update available.
2. delete the channel-prefs.js file from defaults/pref/channel-prefs.js
3. check if defaults/preferences/channel-prefs.js exists and if it does delete it.
4. launch Firefox.
5. verify in about:config that the app.update.channel pref does not exist.
6. verify that you can update to the latest.
Comment 11 Alex Keybl [:akeybl] 2012-06-01 14:36:23 PDT
Comment on attachment 628067 [details] [diff] [review]
patch rev1 - preprocess the channel name into nsUpdateService.js

[Triage Comment]
Approving for Aurora 14 given this is hardening of code and low risk.
Comment 12 Robert Strong [:rstrong] (use needinfo to contact me) 2012-06-03 22:23:42 PDT
Pushed tp mozilla-aurora
https://hg.mozilla.org/releases/mozilla-aurora/rev/49bd90effd98

Note You need to log in before you can comment on or make changes to this bug.