Closed Bug 2009916 Opened 4 months ago Closed 1 month ago

network.getData can timeout for redirects

Categories

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

defect
Points:
3

Tracking

(firefox151 fixed)

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

()

Details

(Whiteboard: [webdriver:m20], [wptsync upstream][webdriver:relnote])

Attachments

(2 files)

Found this issue while investigating https://github.com/firefox-devtools/bidi-har-export/issues/43

The network.getData command is likely to time out for redirected responses if the command is received by the browser before the responseStarted trigger for the redirect has been handled.

The sequence of events for redirects looks as follows:

  • beforeRequestSent for original
  • responseStarted for original -> creates the collectedData map entry for request id
  • responseCompleted for original
  • beforeRequestSent for redirect
  • responseStarted for redirect -> overrides the collectedData map entry for the same request id
  • responseCompleted for redirect

Since both requests share the same request id, we don't attempt to collect the network body for the original response. However we should not blindly override the existing map entry when we receive the events for the redirected response, because existing getData commands might already by waiting on those.

We should check for the existence of the entry in https://searchfox.org/firefox-main/rev/6ece603789f6751c37c48b23f39dbbb16b290592/remote/webdriver-bidi/modules/root/network.sys.mjs#1922,1947-1951,1953,1977-1981

#cloneNetworkRequestBody(request) {
...
  this.#collectedNetworkData.set(
    `${request.requestId}-${DataType.Request}`,
    collectedData
  );
}
...
#cloneNetworkResponseBody(request) {
...
  this.#collectedNetworkData.set(
    `${request.requestId}-${DataType.Response}`,
    collectedData
  );
}

Let's wait for next milestone in case we have other items for network to work on during m20.

Blocks: 1971768
Severity: -- → S3
Priority: -- → P2
Whiteboard: [webdriver:m20]
Points: --- → 3
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/59229 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m20] → [webdriver:m20], [wptsync upstream]

Upstream PR merged by moz-wptsync-bot

Whiteboard: [webdriver:m20], [wptsync upstream] → [webdriver:m20], [wptsync upstream][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: