Closed Bug 1463560 Opened 6 years ago Closed 6 years ago

Previous Firefox session is not restored when there is a pending Firefox update before the OS reboot


(Core :: Widget: Win32, defect)

Not set



Tracking Status
firefox62 --- verified


(Reporter: Abe_LV, Assigned: agashlin)




(2 files)

Steps to reproduce:
Screen capture-

1. Open older Firefox that has the patch from Bug 603903
2. Create a new tab and go to
3. Check for the browser update. When it completes the update file download, do not restart the browser.
4. Restart the OS
5. Verify previous Firefox session is restored.

Actual result:
Sessions are not restored.
Instead, a new Firefox opens with the update applied 

Expected result:
Sessions should be restored in addition to the updates.
Flags: needinfo?(agashlin)
I think this and bug 1463560 (session is not restored when an update was pending) are both due to me stripping out the -os-restarted command line switch early on. I do this early so that we don't treat Firefox restarts as OS restarts. However, in these two cases (update and profile manager), we can't consider the first running Firefox process to be a "real" initialization of the browser. There may be other such cases but I can't think of any, I think they are the exception and thus should be dealt with specially.
Flags: needinfo?(agashlin)
Oops, I thought this was the other bug. I meant to refer to bug 1463263, when tabs are not restored when starting with the profile manager (-p). As the current bug is more serious I'll fix them both under here.
Assignee: nobody → agashlin
Comment on attachment 8981017 [details]
Bug 1463560: Part 2: Re-add the -os-restarted arg when launching from profile manager.

::: toolkit/xre/nsAppRunner.cpp:2180
(Diff revision 1)
>    aProfileSvc->GetStartOffline(&offline);
>    if (offline) {
>      SaveToEnv("XRE_START_OFFLINE=1");
>    }
> +  if (gRestartedByOS) {
> +    // Readd this argument when actually starting the application.

nit - 'readd'
Attachment #8981017 - Flags: review?(jmathies) → review+
Comment on attachment 8981016 [details]
Bug 1463560: Part 1: Re-add the -os-restarted arg when launching after an update.
Attachment #8981016 - Flags: review?(mhowell) → review+
Pushed by
Part 1: Re-add the -os-restarted arg when launching after an update. r=mhowell
Part 2: Re-add the -os-restarted arg when launching from profile manager. r=jimm
Keywords: checkin-needed
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
We have tested this on different Windows OSes and it is verified as fixed.
When the OS restarts during a Firefox update, updates are applied to Firefox and previous sessions are restored. 

Test Environment:
Version 	62.0a1
Build ID 	20180614100146
Update Channel 	nightly
User Agent 	Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
You need to log in before you can comment on or make changes to this bug.