Skip to content

core(network): align headers end time with send when no data received#16044

Merged
connorjclark merged 2 commits intomainfrom
network-headers-end-time
Jun 5, 2024
Merged

core(network): align headers end time with send when no data received#16044
connorjclark merged 2 commits intomainfrom
network-headers-end-time

Conversation

@connorjclark
Copy link
Copy Markdown
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
// 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
Copy Markdown
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.

networkRequestTime: 500,
responseHeadersEndTime: -1,
responseHeadersEndTime: 500,
networkEndTime: 501,
Copy link
Copy Markdown
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
@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