Closed Bug 363741 Opened 18 years ago Closed 17 years ago

Session Restore feature occasionally doesn't restore correct set of windows from last quit

Categories

(Firefox :: Session Restore, defect)

2.0 Branch
PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME
Firefox 3 alpha8

People

(Reporter: darin, Unassigned)

References

Details

(Whiteboard: [fixed by bug 386002?][see comment #5 for STR])

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

A problem intermittently occurs with the Main > Startup: When Firefox Starts pop-up preference when it's set to show my windows and tabs from last time.  After using Firefox 2.0 for several hours and leaving work for home, if I choose Shutdown and Restart Firefox, the same set of windows that I normally see are replaced by a single tabbed window that is the last window that popped up from a website that I visited [eg., a NY Times or Mercury News pop-up window, or a wiki guidelines pop-up window that I had open prior to shutting down the computer which should perform a Quit of Firefox via Apple Events if I'm not mistaken.

This problem doesn't happen every time I quit Firefox, or shutdown the computer either which makes it much more difficult to try to repro and fix.  

I am also using a computer that only has 512MB installed and I typically have a mail client [GyazMail, not Mail.app], the old Proteus chat client and Firefox with 10 or more tabs open simultaneously.  I guess it's possible that a lack or available RAM could contribute to the issue as well 

Reproducible: Sometimes

Steps to Reproduce:
Here's the repro steps:

1. Launch Firefox 2.0 [About Box: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0]
2. Type a web address into the URL field
3. Type Command + T
4. Type another web address into the URL field
5. Repeat steps 3 and 4 above several times until you've got a set of about 10 webpages open [eg., NetVibes, Bloglines, Work Bug dB, Work Wiki, etc. open]

To have these sites open every time I quit and relaunch Firefox 2:

6. Go to the Firefox Menu and select Preferences, then click Main
7. From the Startup section's When Firefox Starts pop-up, choose the show my windows and tabs from last time item and close the Preferences window
8. Shut down the computer by choosing Apple Menu > Shutdown [computer: Apple 15" 1.5GHz PowerBook G4 running 10.4.8 with only 512MB of RAM] and restart the machine
9. Notice that on occasion, only one window with a single tab is recalled instead of all of the pages that are normally remembered with the When Firefox Starts option set as mentioned above 


Actual Results:  
Only one window is returned when I left several open in a tabbed window when the application was Quit.

Expected Results:  
All of my tabbed windows, their associated history, size and position should be returned as they are normally

Additional background info on the issue:

- This occurs most often when a site has auto-popped a window [pop-unders from sites like University of Phoenix after visiting a NY Times or Washington Post email link], or if I click on a link in a tab that pops a new window [like the work wiki text editing guidelines link that creates a new window]

- If you read the last paragraph, you already know that I am not blocking pop-up windows because some sites don't work well with that option enabled

- The problem occurs often after choosing Apple Menu > Shutdown; I'm generally not quitting Firefox [with a Command + Q command], the Mac OS is quitting Firefox for me after I have manually select the Shutdown command

- I have also seen this same issue when I have specifically quit Firefox first [by either typing Command + Q or choose Quit from the File Menu] and then selected Shutdown and restarted at home or work; again, after quitting and relaunching Firefox 2 in this fashion, the only window and associated tab that comes up is the last pop-up window
Today, after shutting down my computer at home and restarting Firefox at work, all of my tabs were blanked again and Firefox opened a blank tab.  I now have 1GB of RAM installed in this computer and I seriously doubt that the issue is RAM related after having witnessed this occurring with 512MB and now with 1GB of RAM an no other apps running.

This is a serious data loss issue as I have pages that I need to have open up again after quitting Firefox.  Often, I can't remember what pages were open after this problem occurs.  

The now obsolete SessionSaver plug-in worked like gangbusters and never forgot my set of tabs after quitting the Firefox app.  If there was a Firefox feature to save sets of tabs for later recall, that would at least recover the last saved set of tabs until someone can get around to looking into this bug.
In case I didn't mention this, I have disabled the block pop-up windows feature.  If I enable it, I think that might be a work-around to the problem.  This might also help with reproduction of the issue.
Unfortunately, enabling the block pop-up windows feature hasn't proven to be a stop-gap for the lost tabs issue reported earlier.  I had a pop-up window appear for some video from BBC America and after shutting down my Mac and returning to work, the only tab that appeared when I restarted Firefox was the video window and not the 12 or so tabs that I had open when I initiated a shutdown of the computer from home.  Just FYI.  It seems like I'm talking to myself but at least I'm documenting what's going on for someone to read at some point in the future.
I've also seen this behavior of randomly not restoring all the pages. In my case if it restores a window it seems to restore the tabs in that window, but it often forgets about multiple windows.

I haven't done it a lot but it seems to remember all the windows if I do a force quit (kill the app) rather than let it shut down.

Due to the bug I have to keep all my tabs in one window :-(
Revised repro steps:

1. Using a Mac, shutdown your computer
2. Turn on the computer and launch Firefox 2
3. Uncheck block pop-up windows checkbox in Prefs
4. Add multiple tabs and select Show my windows and tabs from last time for the when Firefox Starts Prefs pop-up
5. Go to http://www.washingtonpost.com/ and click on a story [observe a pop-up should occur
6. Choose Shutdown from the Apple Menu and wait for the shutdown
7. Launch the computer again and launch Firefox again
8. Observe that only one page appears and not the tabs that you expected
Does this also happen if you close Firefox before step #6? If it doesn't, this is probably the Mac version of bug 342885 (to which there even exists an untested patch in bug 333907).
Component: Preferences → Session Restore
Keywords: qawanted
QA Contact: preferences → session.restore
This occurs often enough for me now that it's really making using Firefox difficult for my work.  

It happens almost every night when I have sites like washingtonpost.com, NYTimes, LATimes.com, Overstock.com, Answers.com, Amazon.com and other sites that kick up pop-unders.  I typically work with 15 to 25 tabs open at one time.  There are tabs open for our company wiki and one of the wiki guidelines pop-ups has caused this to occur [that is, when I've got lots of tabs open and I click the wiki guidelines link that pops a new window, after shutting down and going home to restart, upon relaunching Firefox, the only page that comes up with remember my tabs selected is the wiki guidelines tab; all of the other tabs that were open and their associated histories have been dropped.] 

The Session Restore dialog doesn't come up when this occurs either (as per the description in the bug mentioned here: https://bugzilla.mozilla.org/show_bug.cgi?id=333907 ).  I have seen this dialog on occasion but usually, this only occurs when I've had to force quit the app or some other unexpected anomaly occurs and Firefox has crashed on its own.

I haven't tried quitting Firefox first then shutting down but I can try to remember to do that, although when I leave the office, I'm generally tired and sometimes forget to Quit Firefox and just let the Mac's own Applescript events take care of shutting down apps for me [I think AppleScript is the method for shutting down all of the open apps after a Shutdown command is issued but I'm not sure].

I wish I could tell you more but that's all I know.  The Session Restore window doesn't usually come up.  Only the last popped-up window comes up after the Mac is Restarted and Firefox is relaunched following an end of day Shutdown of the Mac.
I open/close firefox without shutting/down restarting the computer. That is I start up firefox, use it, hit command-q to quit firefox and then later start it up again. Firefox still loses *part* of the session so shutdown of system v shutting down firefox is not the issue.

Firefox doesn't always lose information so its hard to track down. I often have multiple windows open with multiple tabs in each. When firefox restores them it may lose one or more windows.  So far firefox seems to restore at least one window and ***if*** it restores a window all the tabs seem to be there.

Very annoying. Forces me to try to keep all my tabs in one window instead of using multiple windows... or just curse it and go back to safari (has a plug in that restores everything properly with history of sessions).
Dietrich: AFAICT you're using a Mac. Could you please try to reproduce this issue (having several windows opened when you close your OS X session leading to only one of the windows being restored) and then reproduce after having applied attachment #223910 [details] [diff] [review]? This is most probably due to SessionStore not getting a "quit-application-granted" notification before the windows are closed...

Darin: Bug 333907 is actually a windows bug - it just contains a few additional bits of code which should indeed take care of your issue.

Wesley: This sounds like a different bug. Maybe one of bug 367605 and bug 368676, or even a yet unfiled one. If it's neither of the two mentioned bugs and you can reproduce the behavior without having any extensions installed, please file a new one and add possible steps to reproduce and if present all related errors from the Error Console (you'll have to toggle javascript.options.showInConsole to true in about:config first, though). Thanks.
Flags: blocking-firefox3?
Okay, thanks for the heads up Zeniko.  How do I install the patch?  I can see there's an attachment but when I click it, I get a bunch of code text.  If I attempt to save the file its name says "attachment.cgi".

Sorry, I'm not a developer just a black box QA guy so I need some additional instructions to figure out how to apply this patch to test it.  Thanks again.

<DM/>
(In reply to comment #10)
> How do I install the patch?

Uhm - to apply the patch you'd have to recompile Firefox yourself... If you can find anybody to do that for you - great! Otherwise you'll have to wait for a Mac dev to take on this bug, I'm afraid.
Okay, the real day job keeps me staring at an LCD all day so I'll probably pass on attempting to recompile FF for today.  I guess I could try it over the weekend if I get bored.  Got any suggestions on where to look for instructions on acquiring a compilable copy of FF and how to apply the patch?  If not, I can wait for a new development version.  Thanks for all the attention to this issue.  

It's been some time since I filed this and I'm glad to see that there are people out there working on some of these issues.

Is there any way to know when this patch is testable in a nightly build?  Will I be notified so that I can test it out to get it included in a future release of FF?  That would be swell.
(In reply to comment #12)
> instructions on acquiring a compilable copy of FF and how to apply the patch?

Official documentation: http://developer.mozilla.org/en/docs/Build_Documentation

> Is there any way to know when this patch is testable in a nightly build?

When a patch for this issue has been checked in (and is thus available in nightly builds), this bug will be marked as fixed - about which (and all development in this bug) you'll get notified as usual per email.
I have the same problem as Darin, but I cannot see any connection to the pop-ups (I have set Firefox to block pop-ups and the problem occurs also on pages without pop-ups).

I seem to be able to replicate the problem 100 % when Firefox is shut down by OS X. I did not manage to replicate it when closing down Firefox manually (cmd-q).

My steps to replicate:
1) Open Firefox
2) Set the browser to open up the windows and tabs from last session when a new session is started (if this has not already been set)
3) Open at least two windows (number of tabs is irrelevant)
4) Shut down the computer
5) Answer OK if Firefox ask if you want to close a window with several open tabs (if you have set Firefox to ask for it)
6) Start the computer again
7) Start Firefox

Expected result:
Firefox should open with the same windows (and tabs) as when it was closed.

Actual result:
Firefox only opens with one window (it seems to always be the last opened window, no matter which window was on top/had focus, or which window had the last opened tab). All the tabs in the window are preserved from last time (as far as I have seen so far).

Note1:
When Firefox is force-quit, either by the user (me) or because the computer is force-turned off (power plug is pulled or similar), the windows restore just the way they should if I choose to restore the last session.

Note2:
In accordance with the guidelines for bug reporting I did try the latest build (as of today (i.e. May 22) "3.0a5pre"). There the problem could not be replicated because it was obfuscated by another bug: if Firefox, aka Minefield, was quit by OS X as part of the process of closing down the computer, next time it (Firefox/Minefield) was opened it would behave as if it had been quit unexpectedly and ask if I wanted to restore the last session or start a new one. I don't know if this is because of some fix introduced to Darin's problem (or a related one) or if it's simply another (new) bug. However, it means I cannot confirm nor deny whether the bug still exists.

My system info:
- OS: Mac OS X 10.4.9 (build 8P135)
- Computer: PowerBook G4/550MHz, 512 MB RAM
- Firefox version: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; sv-SE; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Confirming per comment #14 for the Bon Echo branch, awaiting further QA for Trunk.

Elias: What you describe in Note2 sounds a lot like the OS X version of Windows bug 333907. Please file a new bug to that end, and - should you have the time - try to reproduce the behavior on older builds (e.g. 3.0 alpha 1 through 4) in order to determine a regression range.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: unspecified → 2.0 Branch
Flags: blocking-firefox3? → blocking-firefox3+
Target Milestone: --- → Firefox 3 beta1
Here are my findings using today's trunk build (Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a6pre) Gecko/2007061804 Minefield/3.0a6pre).

STR:

1. Set the pref to open tabs from the last session
2. Open three tabs
3. Force quit the application from the Activity Monitor
4. Click Restore session when I launch again

The scenario above passes on the trunk. I also tried closing down the computer from the Apple menu (without shutting down Firefox). When I turned it back on and launched Minefield and clicked "Restore Session" all my tabs were there.

My machine specs:

Intel Mac 10.4.9
512 MB 667 MHz RAM
1.83 GHZ Intel Core Duo

It might help if the reporter could let us know the exact set of 10 tabs that he launched. I used Yahoo, Bugzilla, and cnn.com in my test.
At my work, I am regularly viewing http://washingtonpost.com/ but also visit http://nytimes.com/ and latimes.com.  All of these are notorious pay-wall/pop-under sites and as such, pop-ups appear frequently.  Clicking on a window that is a pop-up new window action from an existing page when that's the last thing you do before shutting down the Mac [G4 PowerBook] without quitting Firefox is also a good test.
Ok, I replayed the same steps in Comment 16 but this time with the sites that Darin cites in Comment 17 (latimes.com, nytimes.com, washingtonpost.com) along with a few others. I popped up a few new windows from nytimes and latimes right before I killed the process in Activity Monitor. I was not able to reproduce the issue that Darin is seeing on the trunk.
I am not sure at which point this error message showed up in my Error Console while I was doing this testing, but just wanted to include it in case it is relevant. Error: [Exception... "Component is not available"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: file:///Users/marcia/Desktop/latest%20trunk/Minefield.app/Contents/MacOS/components/nsSessionStore.js :: sss_saveState :: line 1685"  data: no]
Source File: File:///Users/marcia/Desktop/latest%20trunk/Minefield.app/Contents/MacOS/components/nsSessionStore.js
Line: 1685
Marcia: This isn't about force-quitting, it's only about an OS shutdown without exiting Firefox first. And the error from comment #19 should be unrelated (I've intermittently seen it myself in other circumstances at startup).
Whiteboard: see comment #5 for STR
Bug 386002 is another bug which contains a patch which should fix this issue (and even has chances of a check-in).
Depends on: 386002
Whiteboard: see comment #5 for STR → [fixed by bug 386002?][see comment #5 for STR]
Target Milestone: Firefox 3 M7 → Firefox 3 M8
Can anyone still reproduce this bug now that bug 386002 is fixed?
going to resolve as WFM, if anyone can reproduce this still on trunk, please reopen.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
Keywords: qawanted
You need to log in before you can comment on or make changes to this bug.