[whatwg/fetch] Is the timing of "wait for body to be done." affected by long tasks? (#1092)

https://fetch.spec.whatwg.org/#concept-body-wait


I'm asking because I'm trying to work out if the expectations of this test https://github.com/web-platform-tests/wpt/blob/master/xhr/xhr-timeout-longtask.any.js are correct or not. Although that tests XHR, the question comes down to when a request is "done" (see https://xhr.spec.whatwg.org/#ref-for-timed-out-flag%E2%91%A1).

> A body body is said to be done if body is null or body’s stream is closed or errored.

Closing or erroring a stream involves promises being settled, which has to happen in some realm. The obvious answer is that it happens in the realm that initiated the fetch, and so will be affected by long tasks. In which case a fetch won't be "done" until any long tasks are complete. _However_, the existence of synchronous XHR implies that in at least some cases these stream operations are happening in some other realm that continues to execute even when the main thread is blocked.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1092

Received on Thursday, 24 September 2020 17:54:28 UTC