Closed Bug 479994 Opened 16 years ago Closed 16 years ago

Session not restored when exiting from PB mode using "X"

Categories

(Firefox :: Private Browsing, defect, P1)

3.5 Branch
defect

Tracking

()

VERIFIED FIXED
Firefox 3.6a1

People

(Reporter: marcia, Assigned: ehsan.akhgari)

References

Details

(Keywords: dataloss, regression, verified1.9.1)

Attachments

(1 file)

This bug affects only Windows and Linux where you can quit a session using the "X" button. It does not affect Mac. STR: 1. Open a regular browsing session and open some tabs. 2. Switch to PB mode. 3. While in PB mode, close the browser using the "X" button 4. Restart Firefox Expected: My regular browsing session would be restored Actual: Regular Browsing session is not restored During my testing I have found that if you exit using the File menu command the session is properly restored. Bug 468565 contains more information about others that have seen this bug.
Requesting blocking because bug 468565 was only meant as a stopgap so as not to confuse the user, while the effect was loss of a feature in pb.
Flags: blocking-firefox3.1?
Please file Private Browsing related bugs in its own component.
Component: Session Restore → Private Browsing
QA Contact: session.restore → private.browsing
Sorry, was unsure whether this was PB or Session Restore. (In reply to comment #2) > Please file Private Browsing related bugs in its own component.
Assignee: nobody → ehsan.akhgari
Whiteboard: [PB-P2]
Flags: blocking-firefox3.1? → blocking-firefox3.1+
Priority: -- → P2
Adjusting OS and severity. This is a very annoying dataloss bug. Users will normally use this way for closing Firefox. I think that cannot be automatically tested right now and needs a Litmus test, right?
Severity: normal → critical
Flags: in-litmus?
Keywords: dataloss
OS: Mac OS X → Windows Vista
After my initial investigation on this, it seems that this is not really a regression from bug 468565. Even when I locally revert the fix to that bug, this seems to happen. It seems to me that the private-browsing exit notification is not fired at all, which is odd...
Severity: critical → normal
Flags: blocking-firefox3.1+ → blocking-firefox3.1?
Keywords: dataloss
OS: Windows Vista → Mac OS X
Priority: P2 → --
Ehsan, it seems that this is a bug with or without any others, in that when a user quits the app with the [x] the normal sequence of events isn't necessarily *guaranteed*. I'm not 100% sure of this but I do know that exiting via the File menu *may* reduce the reproducibility of this bug. The reason why I think this has been exacerbated now with the patch for bug 468565 is because now there is no dialog, which in turn makes for a clean exit of the app. When the dialog pops-up it seems that firefox has a chance to catch up on the notifications. This is all mostly conjecture from my experience, feel free to ignore it. I'm experiencing this on Vista, so setting OS to All.
OS: Mac OS X → All
Another thing to think about is the fact that the pb service listens to its own notification, i haven't thought much about it yet, but what if a different observer got registered first? I'll look into this to see if this could be a problem...
mconnor: sorry I accidentally flipped the blocking flag here. Could you please re-set it? Thanks!
Severity: normal → critical
Keywords: dataloss
OS: All → Windows Vista
This is a regression from bug 476463. The offending code is: <http://mxr.mozilla.org/mozilla-central/source/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js#174>. nsIWindowMediator.getMostRecentWindow returns null, which causes that code to throw, which will cause the private-browsing notification with exit parameter not being sent. Patch following shortly.
Blocks: 476463
Keywords: regression
OS: Windows Vista → All
Hardware: x86 → All
Attached patch Patch (v1)Splinter Review
Actually the cause was a typo which we missed in the reviews. I fixed that typo, and with that fix along this problem was solved. But anyway I changed the code I mentioned in the last comment to check the returned object to see if it's null, FWIW.
Attachment #364527 - Flags: review?(mconnor)
Let's try to take this for Beta 3...
Whiteboard: [PB-P2]
Target Milestone: --- → Firefox 3.1b3
Crap. I wish there was a way this could be tested, I think some of the places' tests send the quit-application notification, can we do that here?
This needs to be tested as a browser chrome test (because an xpcshell unit test can't execute this code path). Sending that notification from within a browser chrome test will lead to chaos because various parts of the browser try to react to that notification and continuing the test harness would not be reliable.
Comment on attachment 364527 [details] [diff] [review] Patch (v1) r=me on the first part of this patch only, the other bit is done in bug 479461
Attachment #364527 - Flags: review?(mconnor) → review+
Oh, sorry I had missed that bug...
mconnor: can I land this on branch as well without needing approval? I had mistakenly removed the blocking flag on this bug (see comment 8).
Fixed flags, but yeah, get this in please.
Flags: blocking-firefox3.1? → blocking-firefox3.1+
Priority: -- → P1
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [needs 1.9.1 landing]
Keywords: fixed1.9.1
Whiteboard: [needs 1.9.1 landing]
Verified fixed on Windows and Linux with: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2a1pre) Gecko/20090301 Minefield/3.2a1pre Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1b3pre) Gecko/20090301 Shiretoko/3.1b3pre
Status: RESOLVED → VERIFIED
Target Milestone: Firefox 3.1b3 → Firefox 3.2a1
Flags: in-litmus? → in-litmus+
An automated test makes no sense for this bug.
Flags: in-testsuite-
(In reply to comment #22) > An automated test makes no sense for this bug. Please ignore this comment, wrong tab.
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: