Wrong event order of network.responseCompleted for redirects
Categories
(Remote Protocol :: WebDriver BiDi, defect, P2)
Tracking
(Not tracked)
People
(Reporter: jdescottes, Unassigned)
References
(Blocks 2 open bugs, )
Details
(Whiteboard: [webdriver:m11])
When request to URL A redirects to URL B, we currently have the following event order:
beforeRequestSent
for URL AresponseStarted
for URL AbeforeRequestSent
for URL BresponseStarted
for URL BresponseCompleted
for URL AresponseCompleted
for URL B
However, according to step 6 of https://whatpr.org/fetch/1540.html#concept-http-fetch, we should emit responseCompleted for URL A before we start the redirected request. So the expected event order should be:
beforeRequestSent
for URL AresponseStarted
for URL AresponseCompleted
for URL AbeforeRequestSent
for URL BresponseStarted
for URL BresponseCompleted
for URL B
Reporter | ||
Comment 1•3 months ago
|
||
Technically speaking, we are emitting responseCompleted when the input stream for the response is closed, and this will only happen when the response of the redirected request is received. However, we can detect that we have a redirect and force to emit responseCompleted earlier.
Reporter | ||
Comment 2•3 months ago
|
||
For the record here's a possible way to fix it: https://treeherder.mozilla.org/jobs?repo=try&revision=c92cdc8165fdf0ec86eb5036bccce5a2381cf58f
Reporter | ||
Updated•2 months ago
|
Reporter | ||
Comment 3•1 month ago
|
||
Increasing to 3 points because even though my patch on try works, it's not compatible with multiple sessions. A proper solution will require more work.
Reporter | ||
Comment 4•1 month ago
|
||
For reference, this blocks the puppeteer test "network Network Events Page.Events.RequestServedFromCache"
Reporter | ||
Updated•1 month ago
|
Reporter | ||
Updated•1 month ago
|
Reporter | ||
Updated•1 month ago
|
Description
•