-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core(network): align headers end time with send when no data received #16044
Conversation
@@ -381,7 +381,7 @@ class NetworkRequest { | |||
_recomputeTimesWithResourceTiming(timing) { | |||
// Don't recompute times if the data is invalid. RequestTime should always be a thread timestamp. | |||
// If we don't have receiveHeadersEnd, we really don't have more accurate data. | |||
if (timing.requestTime === 0 || timing.receiveHeadersEnd === -1) return; | |||
if (timing.requestTime === -1 || timing.receiveHeadersEnd === -1) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checking against 0 is a mistake given we have test records that start at 0. this caused roundtrip to fail.
@@ -587,7 +587,7 @@ describe('network recorder', function() { | |||
localizedFailDescription: 'net::ERR_ABORTED', | |||
rendererStartTime: 500, | |||
networkRequestTime: 500, | |||
responseHeadersEndTime: -1, | |||
responseHeadersEndTime: 500, | |||
networkEndTime: 501, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this value being -1 when rendererStartTime/networkRequestTime is set is no longer a valid state.
This modifies how our NetworkRequest sets
responseHeadersEnd
in the absence of actual network data received (ex: cached requests or data urls) to match what TraceEngine does. Instead of falling back to the CDP timestamp of the onResponse event, use the timestamp from the willSendRequest event.ref #15841