Last Comment Bug 658280 - Switch Profile does not Prompt to Save existing Session Restore
: Switch Profile does not Prompt to Save existing Session Restore
Status: RESOLVED FIXED
[SmBugEvent]
:
Product: SeaMonkey
Classification: Client Software
Component: Session Restore (show other bugs)
: SeaMonkey 2.1 Branch
: x86 Windows XP
: -- normal (vote)
: seamonkey2.12
Assigned To: neil@parkwaycc.co.uk
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-19 08:25 PDT by therube
Modified: 2012-05-15 11:36 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
fixed
fixed
fixed


Attachments
Proposed patch (1.35 KB, patch)
2012-05-01 01:51 PDT, neil@parkwaycc.co.uk
no flags Details | Diff | Splinter Review
Proposed patch (1.57 KB, patch)
2012-05-03 05:17 PDT, neil@parkwaycc.co.uk
philip.chee: review+
philip.chee: approval‑comm‑aurora+
philip.chee: approval‑comm‑beta+
Details | Diff | Splinter Review

Description therube 2011-05-19 08:25:45 PDT
User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20110511 Firefox/4.0.1 SeaMonkey/2.1
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20110511 Firefox/4.0.1 SeaMonkey/2.1

 
Switching Profile does not prompt to save the existing Session Restore.
Session Restore is not invoked upon returning to initial Profile.
 

Reproducible: Always

Steps to Reproduce:
 
1. Start SeaMonkey, one Window, open one tab in that window
- Profile1
2. Quit SeaMonkey (Ctrl+Q), saving the session (Save and Quit)
3. Restart SeaMonkey
- still Profile1
4. Tools Switch Profile, changing to a different Profile2
- Profile2 opens
5. Tools Switch Profile, change back to Profile1
 

Actual Results:  
 
Profile1 opens.
But Session Restore did not kick in.
Windows/tabs that were opened & saved from the initial Profile1 session are not restored after Switch Profile & then switching back.
 

Expected Results:  
 
Switching Profile should prompt to 'Save and Switch' / 'Switch' / 'Quit'.
If 'Save and Switch' is selected, Session Restore should be invoked upon return to the initial Profile.
 

 
Suppose that sessionstore.json does retain what was there even without explicitly Saving, so about:sessionrestore is able to recover the last session - assuming that you realize this & remember to invoke it.
 
Don't think this applies to FF as I don't believe it has an interactive method to invoke Switch Profile?  (Can only be done from command line/shortcut, so that kind of means you've already exited the browser, so should not be an issue there.)
Comment 1 neil@parkwaycc.co.uk 2012-05-01 01:51:52 PDT
Created attachment 619864 [details] [diff] [review]
Proposed patch

Might as well use Application.restart()'s goodness...
Comment 2 Philip Chee 2012-05-03 02:39:12 PDT
Comment on attachment 619864 [details] [diff] [review]
Proposed patch

OK, this works only if browser.warnOnRestart is set to true. when set to false nsSuiteGlue.js skips not just the close warning prompt but also skips setting |this._saveSession = true|
Comment 3 neil@parkwaycc.co.uk 2012-05-03 02:46:42 PDT
(In reply to Philip Chee from comment #2)
> this works only if browser.warnOnRestart is set to true.
Which is the default...

> when set to
> false nsSuiteGlue.js skips not just the close warning prompt but also skips
> setting |this._saveSession = true|
That's not this bug...
Comment 4 neil@parkwaycc.co.uk 2012-05-03 03:00:25 PDT
(In reply to Philip Chee from comment #2)
> when set to
> false nsSuiteGlue.js skips not just the close warning prompt but also skips
> setting |this._saveSession = true|
We just copied nsBrowserGlue.js, I don't know what's desired. (Firefox seems to always save the session without prompting, but I don't know how that works...)
Comment 5 neil@parkwaycc.co.uk 2012-05-03 05:17:57 PDT
Created attachment 620659 [details] [diff] [review]
Proposed patch

We're quitting the profile, so we need to prompt as such.
Comment 6 Philip Chee 2012-05-03 09:03:51 PDT
Comment on attachment 620659 [details] [diff] [review]
Proposed patch

Right this one works. Although for some reason I needed -purgecaches before I could get it working.
Comment 7 neil@parkwaycc.co.uk 2012-05-03 14:18:18 PDT
Pushed changeset 9f6f5ed9a5a8 to comm-central.
Comment 8 neil@parkwaycc.co.uk 2012-05-03 14:21:18 PDT
Comment on attachment 620659 [details] [diff] [review]
Proposed patch

[Approval Request Comment]
Regression caused by (bug #): 496696 (for browser as described)
User impact if declined: potential dataloss (other windows also affected)
Testing completed (on m-c, etc.): 
Risk to taking this patch (and alternatives if risky): low
String changes made by this patch: none

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