Open Bug 1357935 Opened 7 years ago Updated 2 years ago

Improve logic for when about:sessionrestore is shown

Categories

(Firefox :: Session Restore, enhancement)

enhancement

Tracking

()

Tracking Status
firefox55 --- affected

People

(Reporter: Dolske, Unassigned)

References

(Blocks 1 open bug)

Details

The logic for when about:sessionrestore is shown seems like it has some undesirable edge cases. This logic is basically unchanged from when it was added in bug 448976.

ref: http://searchfox.org/mozilla-central/rev/d8ac097a1de2544f0e51d186bc850662c5b7430a/browser/components/sessionstore/SessionStore.jsm#4235-4261

1) The basic logic is to automagically restore tabs (no about:sessionrestore) after the first crash, but show it after the second crash. (aRecentCrashes > max_resumed_crashes) This is a good way to make restoring seamlessly, but avoid infinite crash-loops when there's a startup crash.

However, "recent crashes" doesn't actually depend on time. The crash count is only reset to zero when you cleanly shutdown the browser. So if you run Firefox for hours or days after the first crash, after crashing again you'll see this page saying "Firefox is having trouble recovering your windows and tabs."

We should reset the crash count after some short period of time. Maybe 5-15 minutes after restoring a previous session? Crashes after that point seem just as likely to be a random crash, and are not really a problem with restoring your tabs.


2) There's an exception to always show about:sessionrestore after the first crash, if it has been more than 6 hours since you crashed. The rationale is in bug 448976 comment 13: at some point the user may not want their previous tabs, and just wants a fresh new session.

Feels like we might want to allow for messaging specific to this case. "Sorry Firefox crashed last time you used it, you can start with your old session or a fresh new session." The point being it's not so much about Firefox having crashed, but that we're not sure if you really want your tabs back at all.

The #2 exceptions should just be suppressed entirely if Firefox is configured to restore your tabs by default anyway. If that's what the user wants and normally sees, it doesn't matter that Firefox crashed 6+ hours ago. For the user it's just a normal browser launch. (In fact, we should reset the crash count, so if Firefox crashes again we don't immediately show the page.)
Blocks: ss-feature
Depends on: 1671271
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.