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

🐛 [RUM-2782] remove buggy redirect timing estimation based on fetchStart #2683

Merged
merged 3 commits into from
Apr 4, 2024

Conversation

BenoitZugmeyer
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer commented Apr 3, 2024

Motivation

The assumptions made when implementing #315 are not accurate anymore:

  • startTime can be different from fetchStart for other reasons than a redirection (ex: when a service worker is involved)

  • Firefox now provide accurate redirectStart and redirectEnd even for cross-origin resources (as long as we have a correct Timing-Allow-Origin header, same as Chrome)

This is a first step to fix #2566

Changes

Remove the redirect timing approximations in RUM resource events.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner April 3, 2024 14:01
@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/remove-redirect-estimation-logic branch from d75de18 to 64ef390 Compare April 3, 2024 14:01
@BenoitZugmeyer
Copy link
Member Author

/to-staging

@dd-devflow
Copy link

dd-devflow bot commented Apr 3, 2024

🚂 Branch Integration: starting soon, merge in < 10m

Commit 64ef390092 will soon be integrated into staging-14.

This build is going to start soon! (estimated merge in less than 10m)

Use /to-staging -c to cancel this operation!

Copy link

cit-pr-commenter bot commented Apr 3, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 155.81 KiB 155.70 KiB -117 B -0.07%
Logs 55.34 KiB 55.34 KiB 0 B 0.00%
Rum Slim 102.30 KiB 102.19 KiB -117 B -0.11%
Worker 25.21 KiB 25.21 KiB 0 B 0.00%

dd-mergequeue bot added a commit that referenced this pull request Apr 3, 2024
…c into staging-14

Co-authored-by: Benoît Zugmeyer <benoit.zugmeyer@datadoghq.com>
@dd-devflow
Copy link

dd-devflow bot commented Apr 3, 2024

🚂 Branch Integration: This commit was successfully integrated

Commit 64ef390092 has been merged into staging-14 in merge commit 9a182d9551.

Check out the triggered pipeline on Gitlab 🦊

@dd-devflow dd-devflow bot added the staging-14 label Apr 3, 2024
Comment on lines 154 to 155
const areRedirectionTimingsInOrder =
!hasRedirection(entry) || areInOrder(entry.startTime, entry.redirectStart, entry.redirectEnd, entry.fetchStart)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥜 nitpick: ‏ I think it would be easier to read as:

Suggested change
const areRedirectionTimingsInOrder =
!hasRedirection(entry) || areInOrder(entry.startTime, entry.redirectStart, entry.redirectEnd, entry.fetchStart)
const areRedirectionTimingsInOrder = hasRedirection(entry)
? areInOrder(entry.startTime, entry.redirectStart, entry.redirectEnd, entry.fetchStart)
: true

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.33%. Comparing base (f644560) to head (76ac2e2).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2683      +/-   ##
==========================================
- Coverage   93.38%   93.33%   -0.05%     
==========================================
  Files         239      239              
  Lines        6937     6931       -6     
  Branches     1526     1524       -2     
==========================================
- Hits         6478     6469       -9     
- Misses        459      462       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BenoitZugmeyer
Copy link
Member Author

/to-staging

@dd-devflow
Copy link

dd-devflow bot commented Apr 4, 2024

🚂 Branch Integration: starting soon, merge in < 10m

Commit 76ac2e2a62 will soon be integrated into staging-14.

This build is going to start soon! (estimated merge in less than 10m)

Use /to-staging -c to cancel this operation!

dd-mergequeue bot added a commit that referenced this pull request Apr 4, 2024
…c into staging-14

Co-authored-by: Benoît Zugmeyer <benoit.zugmeyer@datadoghq.com>
@dd-devflow
Copy link

dd-devflow bot commented Apr 4, 2024

🚂 Branch Integration: This commit was successfully integrated

Commit 76ac2e2a62 has been merged into staging-14 in merge commit d84fda558c.

Check out the triggered pipeline on Gitlab 🦊

@BenoitZugmeyer BenoitZugmeyer merged commit c47a9dd into main Apr 4, 2024
18 checks passed
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/remove-redirect-estimation-logic branch April 4, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Resource Timings are inaccurate when ServiceWorker is involved
5 participants