Open Bug 1022231 Opened 10 years ago Updated 2 years ago

Firefox doesn't remember tabs when using custom history settings, clearing history on shutdown

Categories

(Firefox :: Session Restore, defect, P4)

29 Branch
x86_64
Linux
defect

Tracking

()

People

(Reporter: trondsg+bugzilla+mozilla, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Opera/9.80 (X11; Linux x86_64) Presto/2.12.388 Version/12.16

Steps to reproduce:

Select "show my windows and tabs from last time".
Select "use custom settings for history", "clear history when firefox closes", "browsing and download history".
Open a few tabs.
Close and restart firefox.


Actual results:

Firefox starts with a "Mozilla Firefox Start Page".


Expected results:

When closing and restarting firefox, the tabs should be restored.
When debugging this issue I had numerous more or less intermitting anomalies that I can mostly not reproduce now:

Most important:
- Firefox would not remember tabs, EVEN when using the history setting "remember history" AND selecting "show my windows and tabs from last time"!! (persisted even when disabling all extensions)


- Firefox would not remember tabs, but remembered tabs when disabling an extension and chosing "restart now".

- Firefox would not close down completely (simply hang without error in the console) when using file, quit, but would close down normally when using "restart now" after disabling an extension.

- Firefox would close down completely ONLY when using file, quit, but NOT when using "restart now". (This happened as I started to write this, right now it doesn't happen.)

- Firefox would print an exception to the console while quitting.
Seeing as fixed in FF 43 Linux i686
@Reporter can you confirm this is fixed?
If you still experience issues please send your current operating system and Firefox version.
Flags: needinfo?(trondsg+bugzilla+mozilla)
I still have this problem on 46.0a1 build id 20160109030208 on Linux.

Although maybe it would make more sense to disable the "show my windows and tabs from last time" option when clear history is selected.
Flags: needinfo?(trondsg+bugzilla+mozilla)
WFM on Fx44b7 Win10, the tabs not be cleared, other history be cleared.

See also bug 505548.
Component: Untriaged → Session Restore
@Reporter: this is working for me. Are you still experiencing this problem?

Name 	Firefox
Version 	47.0a1
Build ID 	20160211030242
User Agent 	Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(trondsg+bugzilla+mozilla)
Closing this as incomplete due to inactivity and lack of response from the reporter. 
Feel free to reopen the bug and provide a test case if the issue still reproduces on a current build.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
This bug is still there on Linux 64-bit.
Version 	51.0.1
Build ID 	20170201175806

Select "use custom settings for history", "remember my browsing and download history", and "clear history when firefox closes". Click settings, check "browsing and download history".
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Flags: needinfo?(trondsg+bugzilla+mozilla)
Indeed, I am able to reproduce this on the latest Nightly 54.0a1, Build ID 20170226030205, but in the same time, the two options: 

 - "Remember my browsing and download history" and
 - "Clear history when firefox closes" -> Click settings and check "Browsing and Download History".

are contradictory. As I see this, you either select to remember or to clear Browsing and History.

Mike, could you please take a look?
Flags: needinfo?(mdeboer)
They are contradictory, but from a usability point of view, it would be nice to be able to clear history except open tabs.
This is a very specific feature request to tune the sessionstore behavior with these two conflicting directives.
If someone is willing to cook up a fix for this, I'd be more than willing to assist in design discussion and code reviews.
Blocks: ss-feature
Status: REOPENED → NEW
Flags: needinfo?(mdeboer)
Priority: -- → P4
Summary: Firefox doesn't remember tabs when using custom history settings → Firefox doesn't remember tabs when using custom history settings, clearing history on shutdown

Since I recently ran into deleting all my session tabs after shutdown in Firefox 69.0, I would like to add some thoughts on this:
It's contradictory to remember and clear history at the same time and it's even more confusing:

When I use History > Clear Recent History > and clear all history with "Browsing & Download History" checked, all my session tabs are kept alive.
When I use the same settings under Preferences > Privacy & Security > Clear History when Firefox closes, I loose all tabs.

One could argue, since I shut down the browser, the open session becomes history, but then, with the option Preferences > General > Restore previous session checked, I expect to overwrite the "Clear Browsing & Download History".

This said, "Remember my browsing and download history" and "Restore previous session" should have different effects but it's unclear which.
Maybe "Remember my browsing and download history" is just redundant and could be replaced by "Restore previous session"?

From my point of view, we have an unclear definition of what history in these contexts means. When does a session become history?
Since the answer is not that easy, I suggest one of these two simple solutions:

1.1) If I check Preferences > General > Restore previous session
-> automatically uncheck Preferences > Privacy & Security > Clear History when Firefox closes
-> + give a warning "this overwrites clear history settings"
1.2) the same in opposite direction

  1. or just give a warning in both setting options

This would be more like a workaround until the question when a session becomes history is answered in a global redesign of these settings.

In my opinion, this (and bug 1645161 as well) should be marked as a duplicate of bug 505548 as they're all about the same issue. Keeping multiple bugs open for the same issue just confuses and frustrates those trying to add meaningful information to bug reports.

This bug is not a duplicate of bug 505548. That bug requests a warning when both preferences are selected. This bug suggests respecting both preferences. Personally I'd won't fix 505548. A dialog box to alert the user that their explicit preferences will not be respected is not an adequate substitute for respecting those preferences.

This does look like a duplicate of 1645161.

Well with "duplicate" I mean that all three bug reports tackle "the same problem" (i.e. the contradicting preferences) and should therefore be discussed in one thread, even if there are multiple possible solutions (which is quite normal for many issues).

Ok, reading through the other bug reports, I think all I suggested in my last comment is already discussed in bug 1417150 (even if its discussed as a regression problem).

All these bugs addressing the same settings confusion regarding history settings and session persistence:

I think all these bug reports addressing the same data loss issue you reported in 1645161, Elliotte Rusty Harold.
They may be expressed from different point of views due to the nature of this bug, but the result is the same:
loosing session tabs expected to persist after shutdown.

These are the setting options related to this issue:

  • Preferences > General > Restore previous session
  • Preferences > Privacy & Security > ("use custom settings..." selected) Clear History when Firefox closes > "Browsing & Download History"
  • Preferences > Privacy & Security > "Remember my browsing and download history"
  • History > Clear Recent History > "Browsing & Download History"

So, from my point of view, there is a need to merge these bug reports. I wrote here in this bug after loosing my tabs and Elliotte you opened a new bug report. I don't know who to address here to have a look in this but at least what I wrote in my last comment is redundant to whats discussed as solution in 1417150. I think we all agree that the result should be a better protection of data loss through these inter-dependent preferences options.

After searching further through the bug reports, I found more bugs related to this issue:

I stop adding bugs here but I'm sure there are more addressing this issue, under:
https://bugzilla.mozilla.org/buglist.cgi?product=Firefox&component=Session%20Restore&bug_status=__open__&list_id=15385709

I have the feeling it is also not a matter of a special platform build (some of these bugs here are related to android, others to windows or linux or general), but a basic architecture question of how to define history and active sessions. This affects preference settings but also how to handle crash and session restore. (See also bug 1410877, 431274 and others related to history backup or database issues.)

So this might be an opportunity to close a whole bunch of bugs if this is solved. :-)

(In reply to Nik Tree from comment #17)

After searching further through the bug reports, I found more bugs related to this issue:
<snip>

Most of these are about data loss unrelated to the "clear history when Firefox closes" pref.

I have the feeling it is also not a matter of a special platform build (some of these bugs here are related to android, others to windows or linux or general),

Android uses very different code to desktop Firefox and its session mechanics are different and unrelated.

So this might be an opportunity to close a whole bunch of bugs if this is solved. :-)

The problem is that it is almost impossible, in the case of most of the reports you listed, to figure out why data was not written or was deleted - tracing the absence of something is fundamentally more difficult than the opposite. It is very unlikely those bugs have anything to do with this one. Those bugs are about buggy saving / accidental dataloss.

This bug is about a fairly explicit choice that is being made in the code not to keep/reuse session information for "normal" (ie non-crash) restarts when "clear history when Firefox closes" is turned on, which is not communicated adequately to users.

For a fix for this bug, I believe what we'd need to do is:

  1. add code that avoids clearing the file when we're responding to shutdown/restart-based sanitization ("clear history") requests if and only if "restore previous session" is turned on.
  2. add UI in the preferences next to both checkboxes iff they are in the "conflicting" state (ie we're both clearing history on shutdown and restoring the session) so that users are aware that they cannot have it both ways - if they request for the session to be persisted, history information (namely, the session) stays on disk despite requesting to "clear history when Firefox closes"; if they don't want that, they should turn that feature off.

This isn't super high priority for the folks working on Firefox frontend as it's an edgecase - very, very few users turn on either of these settings, never mind both, but we'd be happy to help people propose / review patches, as already noted in comment #10.

The UI is simpler than you think, though the code might be more complex. From the user's point of view, there are two separate and different things:

  1. The open tabs, controlled by "restore previous session"
  2. The browser history, i.e. URLs I have visited in the past but which are not currently open, controlled by "clear history".

#2 is NOT a subset of #1. They are disjoint sets for purposes of restore, and as a user I expect to be able to control each independently. There is no conflict between "restore previous session" and "clear history" because they do not apply to the same things.

If internally Firefox keeps both #1 and #2 in the same file, that's an implementation detail the user should not need to understand.

Arguably #1 isn't even a list of URLs but rather a set of serialized DOMs or some such thing, but that's a discussion for another issue.

(In reply to Elliotte Rusty Harold from comment #20)

The UI is simpler than you think, though the code might be more complex. From the user's point of view, there are two separate and different things:

  1. The open tabs, controlled by "restore previous session"
  2. The browser history, i.e. URLs I have visited in the past but which are not currently open, controlled by "clear history".

#2 is NOT a subset of #1.

Indeed not.

They are disjoint sets for purposes of restore, and as a user I expect to be able to control each independently.

No, they are not disjoint. The normal reason people want to clear history when quitting the browser is to ensure no data persists on the machine indicating what sites they visit(ed) and what they did on those sites (similar to private browsing).

There is no conflict between "restore previous session" and "clear history" because they do not apply to the same things.

They do apply to the same things, though? The set of open tabs (and their back/forward history, which is in the same dataset) is one part of data we save to disk that can be used for that purpose. If we suddenly start keeping such data with no warning, for sure a significant number of people who use "clear history when Firefox closes" will be surprised. Similarly, "restore previous session" preserves form data, and if so configured, clearing history will clear form data. Similar story for session cookies (x-ref bug 530594) and probably other stuff I'm not thinking of right now. If you think we should radically change how we keep the current session on disk, that's not the subject of this bug.

Severity: normal → S3

The severity field for this bug is relatively low, S3. However, the bug has 22 votes.
:dao, could you consider increasing the bug severity?

For more information, please visit auto_nag documentation.

Flags: needinfo?(dao+bmo)

The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.

Flags: needinfo?(dao+bmo)
You need to log in before you can comment on or make changes to this bug.