[SessionHistory in the parent] One failure in browser_swapDocShells.js
Categories
(Core :: DOM: Navigation, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: alchen, Assigned: kmag)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
text/plain
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
When doing mochitest with attachment 9114933 [details] (patch of bug 1507287) and pref " fission.sessionHistoryInParent", there is still one failure in browser_swapDocShells.js.
TEST-UNEXPECTED-FAIL | browser/components/sessionstore/test/browser_swapDocShells.js | tab was duplicated - Got about:blank, expected about:mozilla
Reporter | ||
Comment 1•5 years ago
|
||
The STR is like below:
- Open a tab (about:mozilla)
let tab = (gBrowser.selectedTab = BrowserTestUtils.addTab(
gBrowser,
"about:mozilla"
)); - Use gBrowser.replaceTabWithWindow() with the tab we just open
let win = gBrowser.replaceTabWithWindow(tab); - Make sure the tab is loaded with URL "about:mozilla"
- Duplicate the tab in step 3.
- Check the URL after the tab is restored.
Reporter | ||
Comment 2•5 years ago
|
||
The problem of this failure is we cannot get sessionHistory when trying to duplicate the tab in step 4.
So we have a blank page in the end.
Reporter | ||
Comment 3•5 years ago
|
||
Reporter | ||
Comment 4•5 years ago
|
||
By disabling the session history in the parent, we can know the correct behavior.
[pref off]
Right after "duplicateTabIn()", we get historychange data from child process.
The data is collected from ContentSessionStore.jsm.
Then we use the data to restoreHistory.
In the end, restoreTabContent will use history.reloadCurrentEntry to reload the current history entry.
0:12.05 GECKO(19446) -----browser_swapDocShell.js before duplicateTabIn
0:12.11 GECKO(19446) ====DEBUG==== @ SessionStore.jsm updateSessionStoreFromTablistener() without aData.sHistoryNeeded.!!!
0:12.14 GECKO(19446) -----browser_swapDocShell.js after duplicateTabIn
0:12.17 GECKO(19446) ====DEBUG==== @ ContentSessionStore.jsm receiveMessage(SessionStore:flush), data={"id":1}!!!
0:12.18 GECKO(19446) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:update), data={"data":{"historychange":{"entries":[{"url":"about:mozilla","title":"The Book of Mozilla, 11:14","cacheKey":0,"ID":0,"docshellUUID":"{d5e8f84b-48bd-4186-a7e4-7a5e31c40383}","resultPrincipalURI":null,"triggeringPrincipal_base64":"eyIzIjp7fX0=","docIdentifier":1,"persist":true}],"userContextId":0,"requestedIndex":0,"index":1,"fromIdx":-1}},"flushID":1,"isFinal":false,"epoch":0}!!!
0:12.26 GECKO(19446) ====DEBUG==== @ ContentSessionStore.jsm receiveMessage(SessionStore:restoreHistory), data={"tabData":{"entries":[{"url":"about:mozilla","title":"The Book of Mozilla, 11:14","cacheKey":0,"ID":0,"docshellUUID":"{d5e8f84b-48bd-4186-a7e4-7a5e31c40383}","resultPrincipalURI":null,"triggeringPrincipal_base64":"eyIzIjp7fX0=","docIdentifier":1,"persist":true}],"lastAccessed":1575991322724,"hidden":false,"attributes":{},"index":1,"userContextId":0,"image":"","userTypedValue":"","userTypedClear":0},"epoch":1,"isRemotenessUpdate":true}!!!
0:12.26 GECKO(19446) ====DEBUG==== @ ContentSessionStore.jsm restoreHistory(tabData={"entries":[{"url":"about:mozilla","title":"The Book of Mozilla, 11:14","cacheKey":0,"ID":0,"docshellUUID":"{d5e8f84b-48bd-4186-a7e4-7a5e31c40383}","resultPrincipalURI":null,"triggeringPrincipal_base64":"eyIzIjp7fX0=","docIdentifier":1,"persist":true}],"lastAccessed":1575991322724,"hidden":false,"attributes":{},"index":1,"userContextId":0,"image":"","userTypedValue":"","userTypedClear":0}!!!
0:12.29 GECKO(19446) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:restoreHistoryComplete), data={"epoch":1,"isRemotenessUpdate":true}!!!
0:12.30 GECKO(19446) ====DEBUG==== @ ContentSessionStore.jsm receiveMessage(SessionStore:restoreTabContent), data={"isRemotenessUpdate":true,"reason":0}!!!
0:12.30 GECKO(19446) ====DEBUG==== @ ContentRestore.jsm restoreTabContent(), TabData.entries=[{"url":"about:mozilla","title":"The Book of Mozilla, 11:14","cacheKey":0,"ID":0,"docshellUUID":"{d5e8f84b-48bd-4186-a7e4-7a5e31c40383}","resultPrincipalURI":null,"triggeringPrincipal_base64":"eyIzIjp7fX0=","docIdentifier":1,"persist":true}]!!!
0:12.37 GECKO(19446) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:restoreTabContentStarted), data={"epoch":1,"isRemotenessUpdate":true,"reason":0}!!!
0:12.42 GECKO(19446) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:restoreTabContentComplete), data={"epoch":1,"isRemotenessUpdate":true}!!!
0:12.42 GECKO(19446) -----browser_swapDocShell.js after promiseTabRestored
0:12.42 PASS tab was duplicated -
Reporter | ||
Comment 5•5 years ago
|
||
[pref on]
When pref on, we need to collect sessionHistory change in the parent process.
As you can see in the log, we cannot get sessionHistory object successfully due to aBrowser.frameLoader is null in this case.
So there is no sessionHistoryChanges in the sessionStore data.
In the end, there's nothing to restore, we get a blank page.
0:11.56 GECKO(16525) -----browser_swapDocShell.js before duplicateTabIn
0:11.61 GECKO(16525) ====DEBUG==== @ SessionStore.jsm updateSessionStoreFromTablistener() with aData.sHistoryNeeded.!!!
0:11.61 GECKO(16525) ====DEBUG==== @ SessionStore.jsm updateSessionStoreFromTablistener() but no SHlistener. Add again!!!
0:11.61 GECKO(16525) ====DEBUG==== addSHistoryListener(), aBrowser.frameLoader not exists,browser.currentURI.displaySpec=null
0:11.61 GECKO(16525) ====DEBUG==== @ SessionStore.jsm updateSessionStoreFromTablistener() with sHistoryNeeded, but no sHlistener!!!
0:11.63 GECKO(16525) -----browser_swapDocShell.js after duplicateTabIn
0:11.67 GECKO(16525) ====DEBUG==== @ ContentSessionStore.jsm receiveMessage(SessionStore:flush), data={"id":1}!!!
0:11.67 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:update), data={"data":{},"flushID":1,"isFinal":false,"epoch":0}!!!
0:11.83 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:AddSHistoryListener), data=null!!!
0:11.85 INFO Console message: SessionStore: [process-switch]: cannot find tabbrowser for loading tab - ignoring
0:11.97 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:AddSHistoryListener), data=null!!!
0:12.00 GECKO(16525) ====DEBUG==== @ ContentSessionStore.jsm receiveMessage(SessionStore:restoreHistory), data={"tabData":{"entries":[],"lastAccessed":1575991224617,"hidden":false,"attributes":{},"image":null,"index":1,"pinned":false},"epoch":1}!!!
0:12.00 GECKO(16525) ====DEBUG==== @ ContentSessionStore.jsm restoreHistory(tabData={"entries":[],"lastAccessed":1575991224617,"hidden":false,"attributes":{},"image":null,"index":1,"pinned":false}!!!
0:12.00 GECKO(16525) ====DEBUG==== @ ContentSessionStore.jsm receiveMessage(SessionStore:restoreTabContent), data={"isRemotenessUpdate":false,"reason":0}!!!
0:12.01 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:restoreSHistoryInParent), data={"epoch":1,"tabData":{"entries":[],"lastAccessed":1575991224617,"hidden":false,"attributes":{},"image":null,"index":1,"pinned":false}}!!!
0:12.01 GECKO(16525) ====DEBUG==== @ ContentSessionStore.jsm receiveMessage(SessionStore:restoreHistoryBottomHalf), data={}!!!
0:12.02 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:restoreHistoryComplete), data={"epoch":1}!!!
0:12.02 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:removeRestoreListener), data={"epoch":1}!!!
0:12.02 GECKO(16525) ====DEBUG==== @ ContentRestore.jsm restoreTabContent(), no TabData.entries there's nothing to restore, we should still blank the page!!!
0:12.04 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:restoreTabContentStarted), data={"epoch":1,"isRemotenessUpdate":false,"reason":0}!!!
0:12.08 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:restoreTabContentComplete), data={"epoch":1,"isRemotenessUpdate":false}!!!
0:12.08 GECKO(16525) -----browser_swapDocShell.js after promiseTabRestored
0:12.08 FAIL tab was duplicated - Got about:blank, expected about:mozilla
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 6•5 years ago
|
||
Comment 8•5 years ago
|
||
Since this is only with fission.sessionHistoryInParent which isn't enabled by default yet, it does not belong to M4.1. Moving this to M5.
Reporter | ||
Comment 9•5 years ago
|
||
If I changed the url from "about:mozilla" to "https://example.org", we can collect sessionHistory changes successfully.
In the end, we can use this history change in the session store data to duplicate the tab.
(In reply to Alphan Chen [:alchen] from comment #5)
[pref on]
When pref on, we need to collect sessionHistory change in the parent process.
As you can see in the log, we cannot get sessionHistory object successfully due to aBrowser.frameLoader is null in this case.
So there is no sessionHistoryChanges in the sessionStore data.
In the end, there's nothing to restore, we get a blank page.0:11.56 GECKO(16525) -----browser_swapDocShell.js before duplicateTabIn
0:11.61 GECKO(16525) ====DEBUG==== @ SessionStore.jsm updateSessionStoreFromTablistener() with aData.sHistoryNeeded.!!!
0:11.61 GECKO(16525) ====DEBUG==== @ SessionStore.jsm updateSessionStoreFromTablistener() but no SHlistener. Add again!!!
0:11.61 GECKO(16525) ====DEBUG==== addSHistoryListener(), aBrowser.frameLoader not exists,browser.currentURI.displaySpec=null
0:11.61 GECKO(16525) ====DEBUG==== @ SessionStore.jsm updateSessionStoreFromTablistener() with sHistoryNeeded, but no sHlistener!!!
0:11.94 GECKO(22071) ====DEBUG==== @SessionStore.jsm updateSessionStoreFromTablistener()------- aData={"data":{"scroll":null,"storage":null,"historychange":{"entries":[{"url":"https://example.org/","title":"mochitest index /","cacheKey":0,"ID":8,"docshellUUID":"{b8494fed-2a34-4c1c-b443-4e13b9f72ed9}","originalURI":"https://example.org/","resultPrincipalURI":"https://example.org/","loadReplace":false,"loadReplace2":true,"principalToInherit_base64":"eyIwIjp7IjAiOiJtb3otbnVsbHByaW5jaXBhbDp7NjQ2MmEzMTEtODVlYi00MGI4LTkwMGMtNDE1MjFlYTNkNzA3fSJ9fQ==","storagePrincipalToInherit_base64":"eyIwIjp7IjAiOiJtb3otbnVsbHByaW5jaXBhbDp7NjQ2MmEzMTEtODVlYi00MGI4LTkwMGMtNDE1MjFlYTNkNzA3fSJ9fQ==","triggeringPrincipal_base64":"eyIzIjp7fX0=","docIdentifier":8589934593,"persist":true}],"userContextId":0,"requestedIndex":0,"index":1,"fromIdx":-1}},"flushID":1,"isFinal":false,"epoch":0}
0:11.63 GECKO(16525) -----browser_swapDocShell.js after duplicateTabIn
0:11.67 GECKO(16525) ====DEBUG==== @ ContentSessionStore.jsm receiveMessage(SessionStore:flush), data={"id":1}!!!
0:11.67 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:update), data={"data":{},"flushID":1,"isFinal":false,"epoch":0}!!!
0:11.83 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:AddSHistoryListener), data=null!!!
0:11.85 INFO Console message: SessionStore: [process-switch]: cannot find tabbrowser for loading tab - ignoring
0:11.97 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:AddSHistoryListener), data=null!!!
0:12.00 GECKO(16525) ====DEBUG==== @ ContentSessionStore.jsm receiveMessage(SessionStore:restoreHistory), data={"tabData":{"entries":[],"lastAccessed":1575991224617,"hidden":false,"attributes":{},"image":null,"index":1,"pinned":false},"epoch":1}!!!
0:12.00 GECKO(16525) ====DEBUG==== @ ContentSessionStore.jsm restoreHistory(tabData={"entries":[],"lastAccessed":1575991224617,"hidden":false,"attributes":{},"image":null,"index":1,"pinned":false}!!!
0:12.00 GECKO(16525) ====DEBUG==== @ ContentSessionStore.jsm receiveMessage(SessionStore:restoreTabContent), data={"isRemotenessUpdate":false,"reason":0}!!!
0:12.01 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:restoreSHistoryInParent), data={"epoch":1,"tabData":{"entries":[],"lastAccessed":1575991224617,"hidden":false,"attributes":{},"image":null,"index":1,"pinned":false}}!!!
0:12.34 GECKO(22071) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:restoreSHistoryInParent), data={"epoch":1,"tabData":{"entries":[{"url":"https://example.org/","title":"mochitest index /","cacheKey":0,"ID":8,"docshellUUID":"{b8494fed-2a34-4c1c-b443-4e13b9f72ed9}","originalURI":"https://example.org/","resultPrincipalURI":"https://example.org/","loadReplace":false,"loadReplace2":true,"principalToInherit_base64":"eyIwIjp7IjAiOiJtb3otbnVsbHByaW5jaXBhbDp7NjQ2MmEzMTEtODVlYi00MGI4LTkwMGMtNDE1MjFlYTNkNzA3fSJ9fQ==","storagePrincipalToInherit_base64":"eyIwIjp7IjAiOiJtb3otbnVsbHByaW5jaXBhbDp7NjQ2MmEzMTEtODVlYi00MGI4LTkwMGMtNDE1MjFlYTNkNzA3fSJ9fQ==","triggeringPrincipal_base64":"eyIzIjp7fX0=","docIdentifier":8589934593,"persist":true}],"lastAccessed":1577111186043,"hidden":false,"attributes":{},"image":null,"userContextId":0,"index":1,"requestedIndex":0,"pinned":false}}!!!
0:12.01 GECKO(16525) ====DEBUG==== @ ContentSessionStore.jsm receiveMessage(SessionStore:restoreHistoryBottomHalf), data={}!!!
0:12.02 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:restoreHistoryComplete), data={"epoch":1}!!!
0:12.02 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:removeRestoreListener), data={"epoch":1}!!!
0:12.02 GECKO(16525) ====DEBUG==== @ ContentRestore.jsm restoreTabContent(), no TabData.entries there's nothing to restore, we should still blank the page!!!
0:12.04 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:restoreTabContentStarted), data={"epoch":1,"isRemotenessUpdate":false,"reason":0}!!!
0:12.08 GECKO(16525) ====DEBUG==== @ SessionStore.jsm receiveMessage(SessionStore:restoreTabContentComplete), data={"epoch":1,"isRemotenessUpdate":false}!!!
0:12.08 GECKO(16525) -----browser_swapDocShell.js after promiseTabRestored
0:12.08 FAIL tab was duplicated - Got about:blank, expected about:mozilla
Reporter | ||
Comment 10•5 years ago
|
||
Add one more finding,
If we add a "TabStateFlusher.flush" before "gBrowser.replaceTabWithWindow(tab)", the test can pass.
https://searchfox.org/mozilla-central/rev/8f7b017a31326515cb467e69eef1f6c965b4f00e/browser/components/sessionstore/test/browser_swapDocShells.js#10
It means that we force collecting the session history change before doing "swap docshell".
In this case, we can collect the session history successfully.
And we restore session history correctly by this data.
However, after doing "swap docshell" we cannot get session history object.
- In the begining, the reason is "no frameloader".
0:11.61 GECKO(16525) ====DEBUG==== addSHistoryListener(), aBrowser.frameLoader not exists,browser.currentURI.displaySpec=null - Recently the reason becomes "no browsingContext". (not sure it is caused timing or code base change)
0:11.64 GECKO(12863) ====DEBUG==== addSHistoryListener(), aBrowser.fl.browsingContext not exists,browser.currentURI.displaySpec=null
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Comment 11•5 years ago
|
||
Tracking for Fission Nightly (M6) because Session Restore doesn't need to block Fission dogfooding (M5).
Reporter | ||
Comment 12•4 years ago
|
||
For this bug, it is a mochitest test failure when enabling sessionHistory in the parent.
This is related to sessionHistory in parent implementation.
Per the previous discussion with Peter, we should check the fission mochitest result after the new implementation is landed.
Since I won't have any action in a short time, unassign the bug now.
Hi Peter,
I cannot find a suitable bug that I can add it into dependency to show this bug block "enabling sessionHistory in the parent".
Could you help?
Comment 13•4 years ago
|
||
M6b
Test depends on fission-history bug.
Updated•4 years ago
|
Comment 14•4 years ago
|
||
Alphan tested and this seems to be passing with sessionHistoryInParent pref on. Keeping this on file to re-test once bug 1656208 is done.
Updated•4 years ago
|
Comment 15•4 years ago
|
||
Andreas, can you look into this one? Comment 14 suggests it might be fixed with SHIP but SHIP-failures spreadsheet has this test so might not be fixed just yet.
Comment 16•4 years ago
|
||
This still repros:
FAIL tab was duplicated - Got "about:blank", expected "about:mozilla"
Stack trace:
chrome://mochikit/content/browser-test.js:test_is:1332
chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_swapDocShells.js:null:18
Updated•4 years ago
|
Updated•4 years ago
|
Comment 17•4 years ago
|
||
This fails in tab duplication so most probably session restore related.
Updated•4 years ago
|
Comment 18•4 years ago
|
||
With SHIP and kashav's sessionstore patch (bug 1673617), it still fails:
0:04.66 INFO Console message: [JavaScript Error: "Error: no SessionHistory object" {file: "resource:///modules/sessionstore/SessionStore.jsm" line: 1046}]
addSHistoryListener@resource:///modules/sessionstore/SessionStore.jsm:1046:13
updateSessionStoreFromTablistener@resource:///modules/sessionstore/SessionStore.jsm:1213:14
updateSessionStoreFromTablistener@resource:///modules/sessionstore/SessionStore.jsm:421:33
SSF_updateSessionStore@resource://gre/modules/SessionStoreFunctions.jsm:450:18
UpdateSessionStore@resource://gre/modules/SessionStoreFunctions.jsm:21:35
flush@resource:///modules/sessionstore/TabStateFlusher.jsm:99:51
flush@resource:///modules/sessionstore/TabStateFlusher.jsm:29:36
ssi_duplicateTab@resource:///modules/sessionstore/SessionStore.jsm:3092:21
ss_duplicateTab@resource:///modules/sessionstore/SessionStore.jsm:308:33
duplicateTabIn@chrome://browser/content/browser.js:8622:20
@chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_swapDocShells.js:15:7
Comment 19•4 years ago
|
||
Assigned this to farre last week in the SHIP meeting but forgot to make the change in Bugzilla.
Comment 20•4 years ago
|
||
Couldn't repro locally anymore, trying try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ec28f3b4ca0c8835de2d3acc904c11499d4abea3
Comment 21•4 years ago
|
||
I can confirm that it still happens on try: https://treeherder.mozilla.org/jobs?repo=try&revision=ec28f3b4ca0c8835de2d3acc904c11499d4abea3&selectedTaskRun=dCtEuFQVRTKyPxvFY0Q61w.0
Updated•4 years ago
|
Comment 22•4 years ago
|
||
Nika looked into the usage and found out the only thing affected because of this is the extension tab duplication which might not work with non-remote tabs.
Updated•4 years ago
|
Assignee | ||
Comment 23•4 years ago
|
||
Comment 24•4 years ago
|
||
Comment 25•4 years ago
|
||
bugherder |
Description
•