Closed Bug 347336 Opened 18 years ago Closed 18 years ago

[SessionStore] Preserve the list of recently closed tabs during one session

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 2

People

(Reporter: zeniko, Assigned: zeniko)

Details

(Keywords: fixed1.8.1)

Attachments

(3 files, 1 obsolete file)

... so that Undo Close Tab is still available after a crash.
Attached patch fix (obsolete) — Splinter Review
Assignee: nobody → zeniko
Status: NEW → ASSIGNED
Attachment #232104 - Flags: review?(dietrich)
> > if (aOverwriteTabs) { > this.restoreWindowFeatures(aWindow, winData, root.opener || null); >+ if (winData._closedTabs) { >+ this._windows[aWindow.__SSi]._closedTabs = winData._closedTabs; >+ } > } Why are you making restoration of this data depend on aOverwriteTabs being true? IIRC, if an app update was downloaded pre-crash and then applied when restarting post-crash, aOverwriteTabs would be false, and we'd want to restore this data in that scenario.
Indeed, at startup we've got root._firstTabs but not aOverwriteTabs set for the very first window. Thanks for catching that.
Attachment #232104 - Attachment is obsolete: true
Attachment #232672 - Flags: review?(dietrich)
Attachment #232104 - Flags: review?(dietrich)
Drivers: This simple patch ensures that the list of recently closed tabs isn't lost after a crash and also allows extensions to restore that list when restoring an arbitrary session (which so far isn't possible). The patch's risk is low.
Flags: blocking-firefox2?
Whiteboard: [has patch][needs review dietrich]
Target Milestone: --- → Firefox 2
Attachment #232672 - Flags: review?(dietrich) → review+
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [has patch][needs review dietrich] → [has patch]
Attachment #232672 - Flags: approval1.8.1?
Flags: blocking-firefox2? → blocking-firefox2+
Whiteboard: [has patch] → [181approval pending]
Comment on attachment 232672 [details] [diff] [review] fix (restores the list at startup and when overwriting a window) a=schrep for drivers - approving all [181approval pending] bugs now that tree is open.
Attachment #232672 - Flags: approval1.8.1? → approval1.8.1+
Whiteboard: [181approval pending] → [checkin needed (1.8 branch)]
Keywords: fixed1.8.1
Whiteboard: [checkin needed (1.8 branch)]
On branch, the patch for this bug caused the regression noted in bug 343871 comment #15.
Status: RESOLVED → REOPENED
Keywords: fixed1.8.1
Resolution: FIXED → ---
This patch fixes a race condition wherein we assumed that the domwindowopened notification would always be received before a window's contents would be restored. The fix initializes windows prior to attempting restoration, for windows have not yet been initialized.
Attachment #235504 - Flags: review?(mconnor)
Whiteboard: [has patch][needs review mconnor]
Comment on attachment 235504 [details] [diff] [review] initialize windows before restoring them good catch, thanks!
Attachment #235504 - Flags: review?(mconnor) → review+
Whiteboard: [has patch][needs review mconnor] → [has patch][checkin needed]
Checking in nsSessionStore.js; /cvsroot/mozilla/browser/components/sessionstore/src/nsSessionStore.js,v <-- nsSessionStore.js new revision: 1.41; previous revision: 1.40 done
Status: REOPENED → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
Whiteboard: [has patch][checkin needed] → [baking][needs a]
Comment on attachment 235504 [details] [diff] [review] initialize windows before restoring them Drivers: This fixes a serious problem in which secondary restored windows have tabs but no content.
Attachment #235504 - Flags: approval1.8.1?
Comment on attachment 235504 [details] [diff] [review] initialize windows before restoring them Dietrich: What happens when restoreWindow is called before the expected onLoad call? AFAICT: onLoad is called now and it will be called later again - thus overwriting the window's __SSi which will effectively clear the list of recently closed tabs and all other data directly added to _windows[aWindow.__SSi]. You'll thus have to add the same check to onLoad as well.
Whiteboard: [baking][needs a] → [need response to comment #11]
I guess that this patch hasn't landed yet, because I still see the problem with todays nightly ( Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1b2) Gecko/20060828 BonEcho/2.0b2 ). P.S. This bug is really annoying and discouraging for testers, because we lose the contents of other windows if we had >1 open before the update.
This addresses Simon's comment by not initializing windows that have already been initialized.
Attachment #235779 - Flags: review?(mconnor)
Attachment #235779 - Flags: approval1.8.1?
Whiteboard: [need response to comment #11] → [needs review mconnor]
Comment on attachment 235779 [details] [diff] [review] add window initialization check to onLoad r+a=me for this, let's get these landed
Attachment #235779 - Flags: review?(mconnor)
Attachment #235779 - Flags: review+
Attachment #235779 - Flags: approval1.8.1?
Attachment #235779 - Flags: approval1.8.1+
Attachment #235504 - Flags: approval1.8.1? → approval1.8.1+
Whiteboard: [needs review mconnor] → [checkin needed(1.8.1)]
Will this also restore the list of Closed Tabs if the user has selected the option of restoring his session (tabs and windows) when starting Firefox. Its the expected behavior. If not, should I file a separate bug for the same?
(In reply to comment #15) This patch indeed also restores the list when resuming a session regularly (without a crash).
Keywords: fixed1.8.1
Whiteboard: [checkin needed(1.8.1)]
Component: General → Session Restore
QA Contact: general → session.restore
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: