Ignored error in "WebDriver:Navigate" and "WebDriver:Refresh" when triggering the actual navigation fails
Categories
(Remote Protocol :: Marionette, defect, P3)
Tracking
(firefox152 fixed)
| Tracking | Status | |
|---|---|---|
| firefox152 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webdriver:m20])
Attachments
(2 files)
When trying to navigate to a page that would cause an error to be thrown within lazy.navigate.navigateTo() we currently completely miss this error because this method is marked async and we do not return the Promise here:
As such the code in lazy.navigate.waitForNavigationCompleted() is not going to wait for the Promise to be resolved and we silently ignore the error.
Solution should add a return statement to the code above to ensure we always return a value but also we can change lazy.navigate.navigateTo() to not be async.
Not sure how to actually trigger that situation given that we already filter out invalid URLs before we start to navigate. At least for now I can see it with my upcoming patch for bug 1579790.
| Assignee | ||
Comment 1•1 month ago
|
||
The WebDriver:Refresh command is affected as well. But in both cases it's currently unlikely that this particular code path is hit.
| Assignee | ||
Comment 2•1 month ago
|
||
Updated•1 month ago
|
Backed out for causing wp failures at /ink-overflow-001-print.html
Backout link
Push with failures
Failure log(s)
| Assignee | ||
Comment 6•1 month ago
|
||
The problem here is an exception for the reload command:
https://treeherder.mozilla.org/logviewer?job_id=561810342&repo=autoland&task=CmsDOrpgSYORhH-R8fYGpQ.0&lineNumber=2855
[task 2026-04-22T19:41:52.888+00:00] 19:41:52 INFO - [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISHistory.reload]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://remote/content/marionette/navigate.sys.mjs :: navigate.refresh :: line 187" data: no]
[task 2026-04-22T19:41:52.888+00:00] 19:41:52 INFO - navigate.refresh@chrome://remote/content/marionette/navigate.sys.mjs:187:36
[task 2026-04-22T19:41:52.888+00:00] 19:41:52 INFO - loadTestUrl/<@chrome://remote/content/marionette/reftest.sys.mjs:669:23
It's exactly that kind of error that we actually missed so far and it's good to see that tests started to fail. Beside the above mentioned tests a couple more wpt reftests are failing:
What's failing is the call to browsingContext.sessionHistory.reload(flags) because that's what we call now when the session history is available since the patch from Julian on bug 2023917 landed. I wonder if calling browsingContext.reload(flags) would work.
| Assignee | ||
Comment 7•1 month ago
|
||
Here a try build with only this patch triggered for the print reftests:
https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=38388
And another try build forcing the reload via browsingContext.reload():
https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=38389
| Assignee | ||
Comment 8•1 month ago
|
||
The original call via browsingContext.reload() still works as the latest try builds show.
Julian pointed me to some extra checks that other components do before calling sessionHistory.reload() and I was trying to see if that could be a solution for us as well. I pushed a try build for just logging the index and count of the sessionHistory before calling reload:
As it can be seen the failure happens when count=0 and index=-1. Under this situation the following check fails:
https://searchfox.org/firefox-main/rev/986b2e474acca54ab469aca8d549b71cdcea33a5/docshell/shistory/nsSHistory.cpp#1705
| Assignee | ||
Comment 9•1 month ago
|
||
| Assignee | ||
Updated•1 month ago
|
Updated•1 month ago
|
Comment 10•1 month ago
|
||
Comment 11•1 month ago
|
||
Comment 13•1 month ago
|
||
I think we might want to try sessionHistory?.count && sessionHistory?.index >= 0 instead of sessionHistory?.count && sessionHistory?.index > 0. If the context is on its first URL sessionHistory.count === 1 and sessionHistory.index === 0, but we should still be able to use this in order to reload via session history.
Hopefully that also works fine for /ink-overflow-001-print.html
| Assignee | ||
Comment 14•1 month ago
|
||
Thanks Julian. Yes, that makes total sense. Not sure why I used > 0 in this case. Nevertheless I do not understand why I'm not getting this affected wdspec test to fail locally while it's perma failing in CI.
| Assignee | ||
Comment 15•1 month ago
|
||
I pushed a new try build for verification:
https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=39514
Comment 16•1 month ago
|
||
Comment 17•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/0af9aa4ca303
https://hg.mozilla.org/mozilla-central/rev/292ba1707ee0
Description
•