Session corrupted: most tab state gone, url moved to userTypedValue
Categories
(Firefox :: Session Restore, defect, P3)
Tracking
()
People
(Reporter: robwu, Unassigned)
Details
Attachments
(1 file)
|
550.54 KB,
application/octet-stream
|
Details |
I witnessed a user losing most of their tabs state on macOS, after failing to update from Firefox 127 to 129.0.2 on 28 august 2024 (when 129.0.2 was the latest version). The update failed because elevated permissions were required to install the component necessary to update Firefox. Upon failing to update, Firefox restarted with the original (old) version. This happened a few of times, and at some point a bug got triggered that resulted in the loss of most tab state. Completing the upgrade by granting elevated access did not resolve the issue.
I extracted the bare minimum from the user profile (of which I still have a full copy) to reproduce the issue.
STR:
- Create a directory, "profdir".
- Put the attached
sessionstore.jsonlz4in that directory. - Launch Firefox with that profile. E.g.
/Applications/Firefox.app/Contents/MacOS/firefox -profile profdiron macOS, orfirefox -profile profdiron Linux. - In the first about:sessionrestore tab ("Restore Session"), choose to restore all tabs (or at least the first window).
Expected:
- All tabs should be restored with their URLs and titles, and any other relevant state.
Actual:
- The restored session looks incomplete:
- The focused tab (tab 7) has title "New Tab" and displays a URL without rendering any content. The displayed URL is actually the "userTypedValue" from the session restore file. If the user interacts with the location bar and presses Esc, the URL disappears.
- Several tabs from tab 9 onwards until the "What's new in Firefox" tab have no tab titles. Upon focusing them a typed URL appears, similar to above.
Additional information:
- The session restore file has 2 "What's new in Firefox" tabs, seemingly suggesting 125.0.2 -> 127.0 and 126.0 -> 129.0.2 upgrades. I witnessed the version to be 127.0 at some point before the update succeeded.
- This Firefox instance is on the regular release channel. The bug happened while 129.0.2 was the latest version, a few days before the 130.0 release.
| Reporter | ||
Comment 1•1 year ago
|
||
Created from original profile (of which I still have the full copy in case you need more information), as follows:
From the terminal, decompress the session restore file and remove the cookies to anonimize it (and prettify it):
dejsonlz4 OriginalProfD/sessionstore.jsonlz4 /dev/stdout | jq '.cookies={}' > /tmp/x.json
From the browser console compress it again:
IOUtils.writeUTF8(
"/tmp/profdir/sessionstore.jsonlz4",
await IOUtils.readUTF8("/tmp/x.json"),
{ compress:true }
);
| Reporter | ||
Comment 2•1 year ago
|
||
Here is the raw entry of the 6th tab:
dejsonlz4 sessionstore.jsonlz4 /dev/stdout | jq '.windows[0].tabs[6]'
{
"entries": [
{
"url": "about:blank",
"title": "about:blank",
"cacheKey": 0,
"ID": 2594423899,
"docshellUUID": "{4a93973d-a6b4-455d-b404-d45f18ce349b}",
"resultPrincipalURI": null,
"hasUserInteraction": true,
"triggeringPrincipal_base64": "{\"3\":{}}",
"docIdentifier": 20,
"persist": true
}
],
"lastAccessed": 1724876355787,
"hidden": false,
"searchMode": null,
"userContextId": 0,
"attributes": {},
"index": 1,
"requestedIndex": 0,
"image": null,
"userTypedValue": "https://www.ikea.com/nl/nl/p/pax-forsand-aheim-kledingkastcombinatie-wit-spiegelglas-s99527404/",
"userTypedClear": 0
}
For comparison, this is the restored second window that includes a successfully restored tab from the same website (the window was created after the tabs in the first window appeared to be broken):
{
"entries": [
{
"url": "about:home",
"title": "New Tab",
"cacheKey": 0,
"ID": 24,
"docshellUUID": "{ada4097c-7ae4-4954-ae12-b9ef75d98d61}",
"resultPrincipalURI": null,
"principalToInherit_base64": "{\"0\":{\"0\":\"moz-nullprincipal:{4535556e-fb52-4b95-9e7e-0cdd22c4dd6b}\"}}",
"hasUserInteraction": true,
"triggeringPrincipal_base64": "{\"3\":{}}",
"docIdentifier": 28,
"persist": true
},
{
"url": "https://www.ikea.com/nl/nl/p/pax-tyssedal-kledingkastcombinatie-wit-wit-s99503295/",
"title": "PAX / TYSSEDAL kledingkastcombinatie, wit/wit, 300x60x236 cm - IKEA",
"cacheKey": 0,
"ID": 26,
"docshellUUID": "{ada4097c-7ae4-4954-ae12-b9ef75d98d61}",
"referrerInfo": "BBoSnxDOS9qmDeAnom1e0AAAAAAAAAAAwAAAAAAAAEYAAAAAAAAAAAABAQAAAAABAA==",
"resultPrincipalURI": null,
"hasUserInteraction": false,
"triggeringPrincipal_base64": "{\"3\":{}}",
"docIdentifier": 30,
"persist": true
}
],
"lastAccessed": 1724875541592,
"hidden": false,
"searchMode": null,
"userContextId": 0,
"attributes": {},
"index": 2,
"userTypedValue": "",
"userTypedClear": 0,
"image": "data:image/svg+xml;base64,...."
}
Comment 3•1 year ago
|
||
Thanks for the report and for isolating the issue. We do attempt to flush or finalize the tab state before writing the session, to get the history entries accurately into the session restore file. It looks like that failed here. It seems like we should be able to populate the current history entry with the URL even if that tab never finishes loading.
Description
•