Skip to content
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

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

connorjclark
Copy link
Collaborator

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

@connorjclark connorjclark requested a review from a team as a code owner June 5, 2024 19:50
@connorjclark connorjclark requested review from adamraine and removed request for a team June 5, 2024 19:50
@@ -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;
Copy link
Collaborator Author

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,
Copy link
Collaborator Author

@connorjclark connorjclark Jun 5, 2024

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.

@connorjclark connorjclark changed the title core(network): align headers end time with send when no data recieved core(network): align headers end time with send when no data received Jun 5, 2024
@connorjclark connorjclark merged commit 2fe8847 into main Jun 5, 2024
27 checks passed
@connorjclark connorjclark deleted the network-headers-end-time branch June 5, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants