Missing "network.responseCompleted" event if "responseStarted" is not received
Categories
(Remote Protocol :: WebDriver BiDi, defect, P3)
Tracking
(Not tracked)
People
(Reporter: lightning00blade, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webdriver:backlog])
Attachments
(1 file)
55.77 KB,
text/x-log
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36
Steps to reproduce:
I run this Puppeteer test should fail when navigating to bad SSL after redirects
https://github.com/puppeteer/puppeteer/blob/main/test/src/navigation.spec.ts#L187
I expect the BiDi event network.responseCompleted
to always have a header list.
As per spec https://w3c.github.io/webdriver-bidi/#get-the-response-data
Step 6 into step 13
Actual results:
The headers parameter is missing on the JSON reponse
Expected results:
The headers property should be empty list
Comment 1•2 years ago
|
||
Thanks for filing! Looking at the code, the only way this could happen would be if for some reason we missed the response started event internally, which is where we fetch headers...
Do you have logs for this failure?
It seems like that is the case I see network.beforeRequestSent
and network.responseCompleted
events. Attached full logs with tracing.
Comment 4•2 years ago
|
||
Thanks, looking at the payload, it's definitely a case where we missed the response started event, although I don't really see anything in the logs which would explain why.
Do I need a specific version of puppeteer to reproduce the issue? I was trying with 20.9.0 and it seemed ok?
We have a fix for that in place for some time, but forgot to file a bug.
https://github.com/puppeteer/puppeteer/blob/main/packages/puppeteer-core/src/common/bidi/HTTPResponse.ts#L61
You will need to manually build a puppeteer version.
Comment 6•2 years ago
|
||
Thanks, I can confirm the issue.
So as suspected it's a case where the NetworkObserver we use skips the responseStarted step. Quickly checked our CDP version, we only emit Network.requestWillBeSent for this scenario.
Will need to take a closer look at the request which fails, but at the very least, we should probably try to emit sensible defaults... or to skip the event if we missed the responseStarted (which would be consistent with our current CDP implementation and also seems to "fix" the test after removing the workaround).
Updated•2 years ago
|
Comment 7•2 years ago
|
||
For later investigations, here's a browser mochitest which only use the network observer and reproduces the "missing response start" issue: https://phabricator.services.mozilla.com/D184385.
And for reference, a patch to skip responseCompleted when responseStarted was missing: https://phabricator.services.mozilla.com/D184384 (but this probably needs more investigations)
Updated•2 years ago
|
Comment 8•2 years ago
|
||
The severity field is not set for this bug.
:whimboo, could you have a look please?
For more information, please visit BugBot documentation.
Updated•2 years ago
|
Comment 9•1 year ago
|
||
Seems like we have another case where responseStarted was missing at https://github.com/firefox-devtools/bidi-har-export/pull/23
Updated•1 year ago
|
Comment 10•4 months ago
|
||
Note that the symptoms for this issue changed a bit since it was reported.
We will now fail to emit the responseCompleted
event because our logic to build the responseCompleted event throws early with:
JavaScript error: chrome://remote/content/shared/listeners/NetworkEventRecord.sys.mjs, line 328: TypeError: can't access property "setResponseSizes", this[#response] is null
This is because this.#response
is created when we prepare the responseStarted event. We might want to guard this at least to write a proper error message, referencing the skipped URL.
Updated•4 months ago
|
Description
•