Open Bug 1879580 Opened 3 months ago Updated 1 month ago

Wrong event order of network.responseCompleted for redirects

Categories

(Remote Protocol :: WebDriver BiDi, defect, P2)

defect
Points:
3

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 A
  • responseStarted for URL A
  • beforeRequestSent for URL B
  • responseStarted for URL B
  • responseCompleted for URL A
  • responseCompleted 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 A
  • responseStarted for URL A
  • responseCompleted for URL A
  • beforeRequestSent for URL B
  • responseStarted for URL B
  • responseCompleted for URL B

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.

Severity: -- → S3
Points: --- → 2
Priority: -- → P2
Whiteboard: [webdriver:m10]

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.

Points: 2 → 3

For reference, this blocks the puppeteer test "network Network Events Page.Events.RequestServedFromCache"

Whiteboard: [webdriver:m10] → [webdriver:m11]
Priority: P2 → P3
Priority: P3 → P2
You need to log in before you can comment on or make changes to this bug.