A resource timing entry is not created if the end of a non-null response body is not reached and there is no consume body steps #1813
Labels
topic: timing
Issues and PR that touch on the infrastructure that is used by ResourceTiming, NavigationTiming, etc
What is the issue with the Fetch Standard?
For example, the given code will not produce a resource timing entry:
Where
/alwayserror
is an endpoint which returns an error status code and a response body containing one byte.In Blink, WebKit and Gecko, they produce a resource timing entry, but they all have a race condition of when it becomes available. In my testing on macOS 15.3.1:
then
setTimeout(() => {}, 0
) for the entry to be available.if (!resp.ok)
path in the above example) produces a resource timing entry straight away in all three, available in the secondthen
callback.On the live web, this is encountered by Cloudflare Turnstile.
This is caused by
processResponseEndOfBody
being called as the flush algorithm when reading the body through a TransformStream in fetch response handover. If the end of the stream is not reached, flushAlgorithm is not called, and thus a resource timing entry is not created.The text was updated successfully, but these errors were encountered: