Bug: after upgrade the previous session store is frozen
Status: UNCONFIRMED
Priority: P3
Created: 2024-03-14 16:28:33+00:00
Resolved: 2024-10-14 16:03:55+00:00

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0

Steps to reproduce:

I upgraded Firefox Debian from 121.0.1 to 123.0 (to test 64-bit time_t migration.
I was having a Gnome Shell crasher I was investigating while starting Firefox to submit reports. After one of the crashes, the session was lost. But the issue here is that somewhat the previous.jsonlz4 in the profile sessionstore-backups folder was still from the time of the upgrade. Is it expected? (ie more than a day before).
So when I backuped the sessionstore-backups, stopped firefox, replace sessionstore.jsonlz4 by sessionstore-backups/previous.jsonlz4 and started firefox I had lost more than a day of context. Note I have opened firefox with session correctly restored more than 3 times since the date of this sessionstore-backups/previous.jzonlz4 file. Somehow I believe the previous.jsonlz4 stop updating after an upgrade. At least after the last crash which lost my session and me replacing the sessionstore.jzonlz4 in the profile folder then starting the previous?jsonlz4 started updating anew.
When I backed up the sessionstore-backups while Firefox gave me only an empty window and recently closed windows and tabs empty, the previous.jzonl4 was the same time that the last upgrade.json.lz4-20240213221259.
And, I had started Firefox after Gnome Shell crashed (due to another project to which I reported the issue), which restored properly.

This might be related to https://bugzilla.mozilla.org/show_bug.cgi?id=1785180 "
firefox quit only keep 3 windows in profile sessionstore.jsonlz4
" as on the previous upgrade (without multiple graphical session crashes only quit/start) I only had 3 windows opened from the previous more than 10 windows session. 

So it could be there is a bug with sessionstore save but only after a Firefox upgrade. 
The crash only made the situation worse.


Actual results:

It seems my sessionstore-backups/previous.jsonlz4 was not updated since the last upgrade (thankfully only two days ago). (though I did not quit Firefox with a clean exit at least since then, so this might be expected).
I cannot tell before Firefox had opened with just an empty window but at the time it did there was no sessionstore.jsonlz4 in the profile directory (probably this file was deleted when Firefox started up with this empty window).
And the recovery.jsonlz4/recovery.baklz4 were replaced by a mostly empty one (probably the current empty window session) of 826 bytes.
There was no storage issue (only the graphical session crashed due to a userspace code issue).

The firefox logs after the graphical session crashes were:
mars 14 14:55:55 hermes firefox.desktop[706981]: ExceptionHandler::GenerateDump cloned child 865686
mars 14 14:55:55 hermes firefox.desktop[706981]: ExceptionHandler::SendContinueSignalToChild sent continue signal to child
mars 14 14:55:55 hermes firefox.desktop[865686]: ExceptionHandler::WaitForContinueSignal waiting for continue signal...
(...)
mars 14 14:55:57 hermes firefox.desktop[711503]: Exiting due to channel error.
(...)

Note that the Firefox session before I lost my session crashed 4 seconds after I started Firefox from the logs so I believe it was not completely loaded. That might be related to the fact I lost my session (though the session lost is not the bug at hand, I will try to reproduce this session loss before opening a bug report, except if you tell me to open it with the limited clues I have).
The issue here is that somehow after a Firefox upgrade, I get an improper session restore.
Do you know how to fake an upgrade to Firefox so I can reproduce it without waiting for the next upgrade?


Expected results:

My sessionstore-backups/previous.jsonlz4 should have been updated upon the previous successful startup which had restored the session after a crash (maybe from sessionstore-backups/recovey.json).