Closed Bug 486696 Opened 16 years ago Closed 15 years ago

Closing browser / switching profile keeps and later restores state / open tabs and history

Categories

(SeaMonkey :: Session Restore, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.1a1

People

(Reporter: 3.14, Assigned: misak.bugzilla)

Details

(Keywords: fixed-seamonkey2.0.4, regression)

Attachments

(1 file, 2 obsolete files)

Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b3pre) Gecko/20090223 SeaMonkey/2.0a3

I assume it is a dupe, but cannot find it. When I close the browser (either quitting SeaMonkey or switching the profile) and later restart that profile, SM starts with the last page, even though I have set it to start with my home page.

This is particularly critical if the page loaded calls a function.

pi
Can you try on clean profile ? Anybody confirmed this bug ? Detail steps to reproduce ?
Status: NEW → UNCONFIRMED
Yes, it happens with a new profile, too. Create new profile, define a home page, set to start with home page. Navigate to whatever other page, switch profile, switch back, observe this is not your home page.

pi
Status: UNCONFIRMED → NEW
This happens, on my Fedora 10 too and didn't exist on Alpha 2. Sessionstore ?
OS: Windows Vista → All
Hardware: x86 → All
Since I end the session regularly it would mean that this state is not saved correctly.

pi
With 2.0b it works again. I just got used to it;-)
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
I don't get it. It's back.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Summary: Last page before browser shown on startup → Closing browser / switching profile keeps and later restores state / open tabs and history
Status: REOPENED → NEW
Component: General → Session Restore
Flags: wanted-seamonkey2?
QA Contact: general → session.restore
I don't see any reason to give this special priority, esp. as it's not clear if this happens for more than one user and what any real impact is, but if it's found to be a bug, fixing it is also not unwanted, so cancelling the wanted flag.
Flags: wanted-seamonkey2.0?
The problem seriously worsened with Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0. Now it is no longer the latest stage but with a previous. So some older pages come up. This is certainly irritating and a privacy issue.
Flags: blocking-seamonkey2.0.1?
Not blocking security updates on this.

Misak, any idea what's up here and how we can solve this in a way that everyone is happy?

Additionally, I'm still not completely sure what the nature of this bug is. Can we have complete steps to reproduce along with expected and actual behavior?
Flags: blocking-seamonkey2.0.1? → blocking-seamonkey2.0.1-
Not quite sure what to say. Let me repeat. I have two profiles (I only use the browser). I switch between the two.

Expectation (old behavior): Get clear browser, i.e. one tab start page as defined

Actual result: Some old state, looks like the state a few seconds before swiching, in most cases not the actual state when switching profiles. This leads in particular to reloading of dynamic pages which may have actions associated. Very bad.

pi
I'd expect the last state of that profile to be restored, actually, just like in a reload or possibly crash scenario.

You say the actual difference is just that it's not that state but a slightly earlier one, i.e. that the real bug is that we don't save the current state when switching?
When the effect first came up (when I originally reported the bug) it was the last state.

Later the behavior changed and it is now often not the last state.
I've found time to look at this bug, it seems that we should check if we should restore when restarting. One liner fix.
Assignee: nobody → misak
Status: NEW → ASSIGNED
Attachment #425697 - Flags: superreview?(neil)
Attachment #425697 - Flags: review?(neil)
Comment on attachment 425697 [details] [diff] [review]
check if we should restore when restarting

The problem is that the switch profile dialog simulates a restart to switch profile, but the session store code assumes that we should always save the session before a restart. Unfortunately not doing this will break existing code that assumes that a restart will save the session.

What you could do is to check for one of the environment variables that the switch profile dialog sets during the restart. Normally these variables get cleared on startup so if they are set it must be because of a profile switch.
Attachment #425697 - Flags: superreview?(neil)
Attachment #425697 - Flags: superreview-
Attachment #425697 - Flags: review?(neil)
I thought that _doResumeSession will be enough ...
Here is the new patch. It checks existance of only one environment variable, hope this will be enough.
Attachment #425697 - Attachment is obsolete: true
Attachment #425756 - Flags: superreview?(neil)
Attachment #425756 - Flags: review?(neil)
Comment on attachment 425756 [details] [diff] [review]
check environment to detect profile switching

>+  _isSwitchingProfile: function sss__isSwitchingProfile() {
Nit: Don't double your underlines. sss_isSwitchingProfile is enough.

>+      var env = Components.classes["@mozilla.org/process/environment;1"]
>+                          .getService(Components.interfaces.nsIEnvironment);
>+      return env.exists("XRE_PROFILE_NAME");
Nit: you've used a 4-space indent here for some reason, should be two spaces.

(In reply to comment #15)
> I thought that _doResumeSession will be enough ...
No, that actually reads sessionstore.resume_session_once ;-)
Attachment #425756 - Flags: superreview?(neil)
Attachment #425756 - Flags: superreview+
Attachment #425756 - Flags: review?(neil)
Attachment #425756 - Flags: review+
For checkin, Nits fixed, carrying forward r+ and sr+ from Neil.
Attachment #425756 - Attachment is obsolete: true
Attachment #425767 - Flags: superreview+
Attachment #425767 - Flags: review+
Keywords: checkin-needed
Comment on attachment 425767 [details] [diff] [review]
for checkin
[Checkin: Comment 18 & 24]


http://hg.mozilla.org/comm-central/rev/71964d95103f
Attachment #425767 - Attachment description: for checkin → for checkin [Checkin: Comment 18]
Status: ASSIGNED → RESOLVED
Closed: 15 years ago15 years ago
Flags: wanted-seamonkey2.0?
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.1a1
Hmm, is wanted-seamonkey2.0 still being monitored? I thought seeking approval‑seamonkey2.0.4 would be the way to go. :-/

@Misak: Good work! I think it would be nice to have it on branch as well. Can you write a short risk assessment comment to help KaiRo/IanN/... judge the possible impactand request branch approval for the patch? Thanks.
Comment on attachment 425767 [details] [diff] [review]
for checkin
[Checkin: Comment 18 & 24]

Unfortunately i don't have 1.9.1 branch to prepare cleanly applying patch, but if nothing changed in nsIEnvironment implementation between 1.9.1 and 1.9.2 it's completely safe IMHO.
Attachment #425767 - Flags: approval-seamonkey2.0.4?
Comment on attachment 425767 [details] [diff] [review]
for checkin
[Checkin: Comment 18 & 24]

Patch already applies cleanly to c-191 as-is. :-)
(In reply to comment #19)
> Hmm, is wanted-seamonkey2.0 still being monitored? I thought seeking
> approval‑seamonkey2.0.4 would be the way to go. :-/

It is. I'll probably get wanted-seamonkey2.0 retired soon, we don't really need it any more.
Attachment #425767 - Flags: approval-seamonkey2.0.4? → approval-seamonkey2.0.4+
Please check in to 1.9.1 branch too.
Keywords: checkin-needed
Comment on attachment 425767 [details] [diff] [review]
for checkin
[Checkin: Comment 18 & 24]


http://hg.mozilla.org/releases/comm-1.9.1/rev/8d34a41d8a74
Attachment #425767 - Attachment description: for checkin [Checkin: Comment 18] → for checkin [Checkin: Comment 18 & 24]
Flags: wanted-seamonkey2.0?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: