Closed
Bug 882007
Opened 11 years ago
Closed 11 years ago
Restart notification is not shown when staging is enabled
Categories
(Toolkit :: Application Update, defect)
Tracking
()
VERIFIED
FIXED
mozilla24
Tracking | Status | |
---|---|---|
firefox21 | --- | wontfix |
firefox22 | --- | wontfix |
firefox23 | + | fixed |
firefox24 | + | verified |
firefox-esr17 | --- | wontfix |
b2g18 | --- | unaffected |
b2g18-v1.0.1 | --- | unaffected |
b2g-v1.1hd | --- | unaffected |
People
(Reporter: robert.strong.bugs, Assigned: robert.strong.bugs)
References
Details
Attachments
(4 files, 15 obsolete files)
25.77 KB,
patch
|
robert.strong.bugs
:
review+
|
Details | Diff | Splinter Review |
81.45 KB,
patch
|
robert.strong.bugs
:
review+
|
Details | Diff | Splinter Review |
20.90 KB,
patch
|
robert.strong.bugs
:
review+
akeybl
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
77.52 KB,
patch
|
robert.strong.bugs
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•11 years ago
|
||
See bug 829221 comment #9
Assignee | ||
Updated•11 years ago
|
Assignee | ||
Comment 2•11 years ago
|
||
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #761280 -
Attachment is obsolete: true
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #761324 -
Attachment is obsolete: true
Assignee | ||
Comment 5•11 years ago
|
||
Attachment #763062 -
Attachment is obsolete: true
Assignee | ||
Comment 6•11 years ago
|
||
Assignee | ||
Comment 7•11 years ago
|
||
Assignee | ||
Comment 8•11 years ago
|
||
getCanStageUpdates needs to check if service is installed as well but I want to do that and a couple of other things in a separate bug since the changes in this bug are getting rather large.
Attachment #763929 -
Attachment is obsolete: true
Attachment #764551 -
Flags: review?(netzen)
Assignee | ||
Updated•11 years ago
|
Attachment #763930 -
Flags: review?(netzen)
Assignee | ||
Comment 9•11 years ago
|
||
This includes a ton of cleanup (I've been meaning to get around to cleaning them up) along with several new tests and fixed tests. I plan on adding tests for background downloads with staging but I want to get the review process started to get this in before the merge.
Attachment #763931 -
Attachment is obsolete: true
Attachment #764552 -
Flags: review?(netzen)
Assignee | ||
Comment 10•11 years ago
|
||
I sent the patches to try https://tbpl.mozilla.org/?tree=Try&rev=13f6d907a94c and here is an earlier try run with essentially the same patches https://tbpl.mozilla.org/?tree=Try&rev=583bf4aab6df So, I think this will be good to go.
Assignee | ||
Comment 11•11 years ago
|
||
Comment on attachment 764551 [details] [diff] [review] 1. main patch rev1 >diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js >--- a/toolkit/mozapps/update/nsUpdateService.js >+++ b/toolkit/mozapps/update/nsUpdateService.js >... >@@ -3122,26 +3137,44 @@ UpdateManager.prototype = { > // Send an observer notification which the update wizard uses in > // order to update its UI. > LOG("UpdateManager:refreshUpdateStatus - Notifying observers that " + > "the update was staged. state: " + update.state + ", status: " + status); > Services.obs.notifyObservers(null, "update-staged", update.state); > > // Do this after *everything* else, since it will likely cause the app > // to shut down. >- if (update.state == STATE_APPLIED) { >+#ifdef MOZ_WIDGET_GONK >+ if (update.state == STATE_APPLIED || update.state == STATE_APPLIED_SVC) { This should just be if (update.state == STATE_APPLIED) { Also, I don't want to change MOZ_WIDGET_GONK until I have time to investigate its behavior here and I'll file a followup for that. > // Notify the user that an update has been staged and is ready for > // installation (i.e. that they should restart the application). We do > // not notify on failed update attempts. > var prompter = Cc["@mozilla.org/updates/update-prompt;1"]. > createInstance(Ci.nsIUpdatePrompt); > prompter.showUpdateDownloaded(update, true); > } else { > releaseSDCardMountLock(); > } >+#else >+ // Only prompt when the UI isn't already open. >+ let windowType = getPref("getCharPref", PREF_APP_UPDATE_ALTWINDOWTYPE, null); >+ if (Services.wm.getMostRecentWindow(UPDATE_WINDOW_NAME) || >+ windowType && Services.wm.getMostRecentWindow(windowType)) { >+ return; >+ } >+ >+ if (update.state == STATE_APPLIED || update.state == STATE_APPLIED_SVC || >+ update.state == STATE_PENDING || update.state == STATE_PENDING_SVC) { >+ // Notify the user that an update has been staged and is ready for >+ // installation (i.e. that they should restart the application). >+ var prompter = Cc["@mozilla.org/updates/update-prompt;1"]. >+ createInstance(Ci.nsIUpdatePrompt); >+ prompter.showUpdateDownloaded(update, true); >+ } >+#endif > },
Assignee | ||
Comment 12•11 years ago
|
||
Comment on attachment 764552 [details] [diff] [review] 3. tests rev1 Removed the following two lines from utils.js locally Services.prefs.setBoolPref("javascript.options.strict", true); Services.prefs.setBoolPref("browser.dom.window.dump.enabled", true);
Assignee | ||
Comment 13•11 years ago
|
||
Comment on attachment 764552 [details] [diff] [review] 3. tests rev1 Also removed this change -var DEBUG_AUS_TEST = false; +var DEBUG_AUS_TEST = true;
Assignee | ||
Comment 14•11 years ago
|
||
It should be possible to remove and / or consolidate these new tests with test_0092, test_0096, and test_0097 but I'd like to think about it more before doing so.
Attachment #764579 -
Flags: review?(netzen)
Assignee | ||
Comment 15•11 years ago
|
||
Another try run with the additional tests included https://tbpl.mozilla.org/?tree=Try&rev=dbe48cc763db
Assignee | ||
Comment 16•11 years ago
|
||
(In reply to Robert Strong [:rstrong] (do not email) from comment #14) > Created attachment 764579 [details] [diff] [review] > 4. more tests rev1 > > It should be possible to remove and / or consolidate these new tests with > test_0092, test_0096, and test_0097 but I'd like to think about it more > before doing so. Also, in a separate bug.
Assignee | ||
Updated•11 years ago
|
status-b2g18:
--- → unaffected
status-b2g18-v1.0.1:
--- → unaffected
status-b2g-v1.1hd:
--- → unaffected
status-firefox21:
--- → affected
status-firefox22:
--- → affected
status-firefox23:
--- → affected
status-firefox24:
--- → affected
status-firefox-esr17:
--- → affected
tracking-firefox23:
--- → ?
tracking-firefox24:
--- → ?
Comment 17•11 years ago
|
||
Comment on attachment 764551 [details] [diff] [review] 1. main patch rev1 Review of attachment 764551 [details] [diff] [review]: ----------------------------------------------------------------- If you'd like to you can push all these patches to: https://hg.mozilla.org/projects/oak/ And then fire off 2 nightly builds here by putting the latest changeset inside the "nightly builds on oak" field: https://secure.pub.build.mozilla.org/buildapi/self-serve/oak And then you can test to make sure updates work fine. If you feel that the local testing and tests are enough though, that's fine. ::: toolkit/mozapps/update/nsUpdateService.js @@ +643,5 @@ > + LOG("getCanStageUpdates - able to stage updates because we'll use the service"); > + return true; > + } > +#endif > + return gCanStageUpdates; It's a bit strange to me that we have both gCanStageUpdates and getCanStageUpdates. Please add a comment to both about the differences and referencing each other so that future people working on this code will know which one to use. And/Or possibly differentiate the names to indicate the difference. @@ +1902,5 @@ > this._offlineStatusChanged(data); > break; > + case "nsPref:changed": > + if (data == PREF_APP_UPDATE_LOG) { > + gLogEnabled = getPref("getBoolPref", PREF_APP_UPDATE_LOG, false); nice :) @@ +3142,5 @@ > > // Do this after *everything* else, since it will likely cause the app > // to shut down. > +#ifdef MOZ_WIDGET_GONK > + if (update.state == STATE_APPLIED || update.state == STATE_APPLIED_SVC) { nit: update.state == STATE_APPLIED_SVC is only used on windows @@ +3158,5 @@ > + let windowType = getPref("getCharPref", PREF_APP_UPDATE_ALTWINDOWTYPE, null); > + if (Services.wm.getMostRecentWindow(UPDATE_WINDOW_NAME) || > + windowType && Services.wm.getMostRecentWindow(windowType)) { > + return; > + } Rather than checking this pref again, I think you can just do let altUpdateWindow = this._getAltUpdateWindow(); let updateWindow = Services.wm.getMostRecentWindow(UPDATE_WINDOW_NAME); if (altUpdateWindow || updateWindow) { return; }
Attachment #764551 -
Flags: review?(netzen) → review+
Updated•11 years ago
|
Attachment #763930 -
Flags: review?(netzen) → review+
Comment 18•11 years ago
|
||
Comment on attachment 764552 [details] [diff] [review] 3. tests rev1 Review of attachment 764552 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/mozapps/update/test/chrome/test_0097_restartNotification_stagedServiceBackground.xul @@ +23,5 @@ > pageid: PAGEID_FINISHED_BKGRD, > buttonClick: "extra1" > } ]; > > +var g nit: I don't think this should be here ::: toolkit/mozapps/update/test/chrome/utils.js @@ +186,5 @@ > > // Set to true to log additional information for debugging. To log additional > // information for an individual test set DEBUG_AUS_TEST to true in the test's > // onload function. > +var DEBUG_AUS_TEST = true; Is this intentionally left true? @@ +806,5 @@ > /** > + * Creates a backup of files the tests need to modify so they can be restored to > + * the original file when the test has finished and then modifies the files. > + */ > +function setupFiles() { It would be nice to maybe pass in the basedir here with getAppBasesDir() as the default if not passed, and then use it in the other tests that have this code duplicated, but I won't hold up the review for that. @@ +872,5 @@ > > /** > + * Restores files that were backed up for the tests and general file cleanup. > + */ > +function resetFiles() { see note in setupFiles ::: toolkit/mozapps/update/test/sharedUpdateXML.js @@ +36,5 @@ > + "dd8d7be2859cfd2f75b242f272a8fbbcbe4419d399259" + > + "35d732"; > +const SHA512_HASH_SIMPLE_MAR = "9f9afbb5a6fa70e71fa28c73c5b1968cf8831ae02ebd4" + > + "28839ed2acf0b257c08c76c1f286c94c029dd3a4ad708" + > + "f9703f61e6bf5f30982e9deee7d6838c1dbe14"; This seems fine but just wanted to check why these are changing ::: toolkit/mozapps/update/test_svc/unit/test_0203_app_launch_apply_update_svc.js @@ +261,5 @@ > resetEnvironment(); > > let processDir = getAppDir(); > // Restore the backup of the updater.ini if it exists > + // Restore the backup of the updater.ini if it exists. nit: This comment already exists, pls remove the dupe without the period
Attachment #764552 -
Flags: review?(netzen) → review+
Updated•11 years ago
|
Attachment #764579 -
Flags: review?(netzen) → review+
Assignee | ||
Comment 19•11 years ago
|
||
(In reply to Brian R. Bondy [:bbondy] from comment #18) > Comment on attachment 764552 [details] [diff] [review] > 3. tests rev1 > > Review of attachment 764552 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: > toolkit/mozapps/update/test/chrome/ > test_0097_restartNotification_stagedServiceBackground.xul > @@ +23,5 @@ > > pageid: PAGEID_FINISHED_BKGRD, > > buttonClick: "extra1" > > } ]; > > > > +var g > > nit: I don't think this should be here Fixed > ::: toolkit/mozapps/update/test/chrome/utils.js > @@ +186,5 @@ > > > > // Set to true to log additional information for debugging. To log additional > > // information for an individual test set DEBUG_AUS_TEST to true in the test's > > // onload function. > > +var DEBUG_AUS_TEST = true; > > Is this intentionally left true? No... see comment #13 > @@ +806,5 @@ > > /** > > + * Creates a backup of files the tests need to modify so they can be restored to > > + * the original file when the test has finished and then modifies the files. > > + */ > > +function setupFiles() { > > It would be nice to maybe pass in the basedir here with getAppBasesDir() as > the default if not passed, and then use it in the other tests that have this > code duplicated, but I won't hold up the review for that. This is mochitest specific and there are already xpcshell helpers for that where they make multiple calls. I'll look into it when I do more test code cleanup. > > @@ +872,5 @@ > > > > /** > > + * Restores files that were backed up for the tests and general file cleanup. > > + */ > > +function resetFiles() { > > see note in setupFiles > > ::: toolkit/mozapps/update/test/sharedUpdateXML.js > @@ +36,5 @@ > > + "dd8d7be2859cfd2f75b242f272a8fbbcbe4419d399259" + > > + "35d732"; > > +const SHA512_HASH_SIMPLE_MAR = "9f9afbb5a6fa70e71fa28c73c5b1968cf8831ae02ebd4" + > > + "28839ed2acf0b257c08c76c1f286c94c029dd3a4ad708" + > > + "f9703f61e6bf5f30982e9deee7d6838c1dbe14"; > > This seems fine but just wanted to check why these are changing The mochitests are now using simple.mar instead of simple_no_pib.mar so the hash changes. I've also added FILE_SIMPLE_NO_PIB_MAR and associated hashes which used to be FILE_SIMPLE_MAR since I want to add mochitests using them. > > ::: > toolkit/mozapps/update/test_svc/unit/test_0203_app_launch_apply_update_svc.js > @@ +261,5 @@ > > resetEnvironment(); > > > > let processDir = getAppDir(); > > // Restore the backup of the updater.ini if it exists > > + // Restore the backup of the updater.ini if it exists. > > nit: This comment already exists, pls remove the dupe without the period Fixed
Assignee | ||
Comment 20•11 years ago
|
||
(In reply to Brian R. Bondy [:bbondy] from comment #17) > Comment on attachment 764551 [details] [diff] [review] > 1. main patch rev1 > > Review of attachment 764551 [details] [diff] [review]: > ----------------------------------------------------------------- > > If you'd like to you can push all these patches to: > https://hg.mozilla.org/projects/oak/ > > And then fire off 2 nightly builds here by putting the latest changeset > inside the "nightly builds on oak" field: > https://secure.pub.build.mozilla.org/buildapi/self-serve/oak > > And then you can test to make sure updates work fine. If you feel that the > local testing and tests are enough though, that's fine. I pretty confident these changes are safe to land as is. > > ::: toolkit/mozapps/update/nsUpdateService.js > @@ +643,5 @@ > > + LOG("getCanStageUpdates - able to stage updates because we'll use the service"); > > + return true; > > + } > > +#endif > > + return gCanStageUpdates; > > It's a bit strange to me that we have both gCanStageUpdates and > getCanStageUpdates. Please add a comment to both about the differences and > referencing each other so that future people working on this code will know > which one to use. And/Or possibly differentiate the names to indicate the > difference. Fixed > @@ +1902,5 @@ > > this._offlineStatusChanged(data); > > break; > > + case "nsPref:changed": > > + if (data == PREF_APP_UPDATE_LOG) { > > + gLogEnabled = getPref("getBoolPref", PREF_APP_UPDATE_LOG, false); > > nice :) It is about time isn't it? :) > > @@ +3142,5 @@ > > > > // Do this after *everything* else, since it will likely cause the app > > // to shut down. > > +#ifdef MOZ_WIDGET_GONK > > + if (update.state == STATE_APPLIED || update.state == STATE_APPLIED_SVC) { > > nit: update.state == STATE_APPLIED_SVC is only used on windows Already fixed (see comment #11) > > @@ +3158,5 @@ > > + let windowType = getPref("getCharPref", PREF_APP_UPDATE_ALTWINDOWTYPE, null); > > + if (Services.wm.getMostRecentWindow(UPDATE_WINDOW_NAME) || > > + windowType && Services.wm.getMostRecentWindow(windowType)) { > > + return; > > + } > > Rather than checking this pref again, I think you can just do > let altUpdateWindow = this._getAltUpdateWindow(); > let updateWindow = Services.wm.getMostRecentWindow(UPDATE_WINDOW_NAME); > if (altUpdateWindow || updateWindow) { > return; > } this._getAltUpdateWindow is in UpdatePrompt. I considered refactoring things but chose to hold off on it.
Updated•11 years ago
|
Assignee | ||
Comment 21•11 years ago
|
||
Carrying forward r+
Attachment #764551 -
Attachment is obsolete: true
Attachment #765045 -
Flags: review+
Assignee | ||
Comment 22•11 years ago
|
||
I'm going to fix the hasMutex issue I discussed on irc with you in another bug.
Attachment #763930 -
Attachment is obsolete: true
Attachment #765047 -
Flags: review?(netzen)
Assignee | ||
Comment 23•11 years ago
|
||
carrying forward r+
Attachment #764552 -
Attachment is obsolete: true
Attachment #765048 -
Flags: review+
Assignee | ||
Comment 24•11 years ago
|
||
carrying forward r+
Attachment #764579 -
Attachment is obsolete: true
Attachment #765055 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Attachment #764579 -
Attachment description: 4. more tests rev1 → 5. more tests rev1
Attachment #764579 -
Attachment is obsolete: false
Assignee | ||
Comment 25•11 years ago
|
||
(In reply to Robert Strong [:rstrong] (do not email) from comment #22) > Created attachment 765047 [details] [diff] [review] > 2. additional fixes > > I'm going to fix the hasMutex issue I discussed on irc with you in another > bug. Filed bug 885096
Assignee | ||
Comment 26•11 years ago
|
||
Assignee | ||
Comment 27•11 years ago
|
||
Assignee | ||
Comment 28•11 years ago
|
||
Also running the changes through try again https://tbpl.mozilla.org/?tree=Try&rev=acd8a42275d2
Updated•11 years ago
|
Attachment #765047 -
Flags: review?(netzen) → review+
Assignee | ||
Comment 29•11 years ago
|
||
Pushed combined main patch to mozilla-inbound https://hg.mozilla.org/integration/mozilla-inbound/rev/c7f6325c015e
Attachment #765045 -
Attachment is obsolete: true
Attachment #765047 -
Attachment is obsolete: true
Attachment #765048 -
Attachment is obsolete: true
Attachment #765126 -
Flags: review+
Assignee | ||
Comment 30•11 years ago
|
||
Pushed to mozilla-inbound https://hg.mozilla.org/integration/mozilla-inbound/rev/5d23a7000b52
Attachment #764579 -
Attachment is obsolete: true
Attachment #765055 -
Attachment is obsolete: true
Attachment #765127 -
Flags: review+
Assignee | ||
Comment 31•11 years ago
|
||
Fixed a typo in a log message
Attachment #765081 -
Attachment is obsolete: true
Assignee | ||
Comment 32•11 years ago
|
||
Attachment #765094 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Flags: in-testsuite+
Assignee | ||
Comment 33•11 years ago
|
||
I ran tests on Win 7 aurora and they passed as well.
Comment 34•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/c7f6325c015e https://hg.mozilla.org/mozilla-central/rev/5d23a7000b52
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Assignee | ||
Comment 35•11 years ago
|
||
I discussed this bug with akeybl today and decided on holding off on requesting branch approval until after it has baked a little longer. We can evaluate taking this on beta in a week or so. Also, the aurora patches will be applicable for beta by that time.
Assignee | ||
Comment 36•11 years ago
|
||
I verified this with a background update by changing app.update.promptWaitTime to 10 and app.update.idletime to 10 Both the "toast" notification and the restart prompt were displayed.
Assignee | ||
Comment 37•11 years ago
|
||
bug 829221 uncovered this bug and can be used to verify that this is fixed. akeybl has asked to get this onto beta if possible so asking for verification on aurora / nightly.
Flags: needinfo?(anthony.s.hughes)
Keywords: verifyme
Comment 38•11 years ago
|
||
Is the snippet from bug 829221 comment 1 still available to qualify this?
Flags: needinfo?(anthony.s.hughes)
QA Contact: anthony.s.hughes
Comment 40•11 years ago
|
||
I've set it up again, see bug 829221 comment #22.
Flags: needinfo?(nthomas)
Comment 41•11 years ago
|
||
This is working for Firefox 24.0a1 2013-06-22 on Windows 7.
Assignee | ||
Comment 42•11 years ago
|
||
Comment on attachment 765128 [details] [diff] [review] Beta main patch [Approval Request Comment] Bug caused by (feature/regressing bug #): bug 307181 User impact if declined: Windows users with the service and staging enabled won't be notified to restart Firefox primarily after an update has been downloaded and staged in the background. This also blocks bug 829221 and bug 829227 and akeybl asked me to uplift this if I felt it was safe to do so which I do. Testing completed (on m-c, etc.): on m-c, verified by QA, verified by myself, and has very good test coverage in the tree. Risk to taking this patch (and alternatives if risky): minimal due to testing completed. String or IDL/UUID changes made by this patch: None.
Attachment #765128 -
Attachment description: Aurora main patch → Beta main patch
Attachment #765128 -
Flags: review+
Attachment #765128 -
Flags: approval-mozilla-beta?
Assignee | ||
Updated•11 years ago
|
Attachment #765129 -
Attachment description: Aurora test patch → Beta test patch
Attachment #765129 -
Flags: review+
Comment 43•11 years ago
|
||
Comment on attachment 765128 [details] [diff] [review] Beta main patch \o/ \o/ \o/
Attachment #765128 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Assignee | ||
Comment 44•11 years ago
|
||
Pushed to mozilla-beta https://hg.mozilla.org/releases/mozilla-beta/rev/bf59aa6d1747 This actually landed in time for the Firefox 23 merge so changing milestone.
Target Milestone: mozilla24 → mozilla23
Assignee | ||
Comment 45•11 years ago
|
||
meh... so many version numbers! It landed for Firefox 24 so putting milestone back
Target Milestone: mozilla23 → mozilla24
Updated•11 years ago
|
Comment 46•11 years ago
|
||
This doesn't meet ESR landing criteria, wontfixing for that branch.
You need to log in
before you can comment on or make changes to this bug.
Description
•