Handler function threw an exception: TypeError: channel.visitRequestHeaders is not a function
Categories
(Remote Protocol :: WebDriver BiDi, defect, P2)
Tracking
(firefox-esr115 unaffected, firefox122 unaffected, firefox123 unaffected, firefox124 fixed, firefox125 fixed)
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox122 | --- | unaffected |
| firefox123 | --- | unaffected |
| firefox124 | --- | fixed |
| firefox125 | --- | fixed |
People
(Reporter: whimboo, Assigned: jdescottes)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [webdriver:m10])
Attachments
(1 file)
|
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
|
Details | Review |
Running the following code in the WebDriver BiDi client results in an error within the NetworkUtils.sys.mjs module.
async function evaluate(context, expression, options = {}) {
const { awaitPromise = true } = options;
const res = await sendCommand("script.evaluate", {
expression,
target: { context },
awaitPromise,
});
return res.result.result;
}
function sleep(time = 1000) {
return new Promise(resolve => window.setTimeout(resolve, time));
}
(async function () {
await sendCommand("session.new", { capabilities: {} });
let res = await sendCommand("browsingContext.getTree", {});
let context = res.result.contexts[0].context;
await sendCommand("session.subscribe", { events: ["network"] });
await sendCommand("browsingContext.navigate", {
context,
url: "https://self-signed.badssl.com/",
wait: "none",
});
await sleep(5000);
})()
The error as raised:
Handler function threw an exception: TypeError: channel.visitRequestHeaders is not a function
Stack: fetchRequestHeadersAndCookies@resource://devtools/shared/network-observer/NetworkUtils.sys.mjs:411:11
NetworkEventRecord@chrome://remote/content/shared/listeners/NetworkEventRecord.sys.mjs:63:25
#onNetworkEvent@chrome://remote/content/shared/listeners/NetworkListener.sys.mjs:101:12
#createNetworkEvent@resource://devtools/shared/network-observer/NetworkObserver.sys.mjs:740:48
@resource://devtools/shared/network-observer/NetworkObserver.sys.mjs:536:31
makeInfallible/<@resource://devtools/shared/DevToolsInfaillibleUtils.sys.mjs:43:22
inheritAttribute@chrome://global/content/customElements.js:375:18
attributeChangedCallback@chrome://global/content/customElements.js:315:16
setIcon@chrome://browser/content/tabbrowser.js:1010:16
setIconFromLink@resource:///actors/LinkHandlerParent.sys.mjs:161:16
receiveMessage@resource:///actors/LinkHandlerParent.sys.mjs:60:14
Line: 411, column: 11
Interestingly in NetworkObserver.sys.mjs:740 we run the following code for a nsIFileChannel:
fileActivity.owner = this.#onNetworkEvent({}, channel);
But why do we run this code? Why is this a file channel? I cannot actually debug because adding the debugger statement around those lines and having the browser toolbox open crashes Firefox immediately.
Julian could you please check? This blocks at least one Puppeteer test.
| Reporter | ||
Comment 1•1 year ago
|
||
Maybe a regression from bug 1870580?
| Reporter | ||
Comment 2•1 year ago
|
||
Ok, this seems to come from running aTab.setAttribute("iconloadingprincipal", aLoadingPrincipal); which most likely sets the tab icon. That's why we have a file channel.
With a Nightly build that doesn't have the change from bug 1870580 yet, the Puppeteer test still fails. So it's not related.
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 3•1 year ago
|
||
Valetin, could you team please have a look at this issue. It's massively spamming the log and makes it harder to investigate test failures for jobs using WebDriver BiDi. Thanks!
Comment 4•1 year ago
•
|
||
It seems pretty clear that this is related with bug 1870580.
I can't figure out from the patch what's wrong, but we should be able to avoid the error by checking if the channel QIs to nsIHttpChannel before calling visitRequestHeaders ?
| Assignee | ||
Comment 5•1 year ago
|
||
I will take a look and see how we should handle those channels in BiDi. File channels don't support the same APIs as HTTP channels, so we might just skip them until we fully support them in Bug 1826210
Comment 6•1 year ago
|
||
Set release status flags based on info from the regressing bug 1870580
| Assignee | ||
Comment 7•1 year ago
|
||
File channels do not support the same APIs as other channels and make the NetworkEventRecord throw.
Support should be added in Bug 1826210.
Updated•1 year ago
|
Comment 9•1 year ago
|
||
| bugherder | ||
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 10•1 year ago
|
||
Comment on attachment 9382233 [details]
Bug 1880160 - [bidi] Ignore file channels in BiDi network listener
Beta/Release Uplift Approval Request
- User impact if declined: When listening to network events with WebDriver BiDi, a lot of errors will pollute the stdout.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): We don't really have an automated test to check that the logs are no longer polluted with random errors, but the modified code only impacts WebDriver BiDi clients and is simply ignoring a new type of network channel, which we don't support correctly yet.
- String changes made/needed:
- Is Android affected?: No
Comment 11•1 year ago
|
||
Comment on attachment 9382233 [details]
Bug 1880160 - [bidi] Ignore file channels in BiDi network listener
Approved for 124.0b4
Comment 12•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Description
•