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

fix(tracing): Don't finish React Router 6 pageload transactions early #6609

Merged
merged 6 commits into from
Jan 4, 2023

Conversation

lforst
Copy link
Member

@lforst lforst commented Dec 22, 2022

Fixes #6470

This PR fixes a bug where we prematurely finish pageload transactions in our React Router 6 implementation due to some funky logic.

h/t to @onurtemizkan for doing the foundational work on this in #6599

@lforst lforst changed the title Draft React router fix draft Dec 22, 2022
@onurtemizkan
Copy link
Collaborator

@lforst -- Ran it through debugger, and seems to be working fine. (with and without HMR involved) 👍

@lforst
Copy link
Member Author

lforst commented Jan 3, 2023

@lforst -- Ran it through debugger, and seems to be working fine. (with and without HMR involved) 👍

@onurtemizkan Awesome, thanks for testing. I will pass this by someone from the team and merge it in. I think we can close #6599 in the meanwhile - thanks for doing the foundational work!!

@lforst lforst changed the title React router fix draft fix(tracing): Don't finish React Router 6 pageload transactions early Jan 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.8 KB (+0.01% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 61.34 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.58 KB (+0.01% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 54.93 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.34 KB (0%)
@sentry/browser - Webpack (minified) 66.46 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.36 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.62 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.76 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.2 KB (-0.01% 🔽)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.11 KB (+0.04% 🔺)
@sentry/replay - Webpack (gzipped + minified) 38.19 KB (+0.05% 🔺)

@lforst lforst marked this pull request as ready for review January 3, 2023 15:00
Copy link
Collaborator

@onurtemizkan onurtemizkan left a comment

Choose a reason for hiding this comment

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

Looks good to me! 🚀

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Great work, looks like a good fix to me!

@@ -179,28 +170,28 @@ export function withSentryReactRouterV6Routing<P extends Record<string, any>, R
return Routes;
}

let isBaseLocation: boolean = false;
let routes: RouteObject[];
let previousLocation: Location | null = null;
Copy link
Member

Choose a reason for hiding this comment

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

l: As discussed we can change this to a boolean

Copy link
Member Author

Choose a reason for hiding this comment

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

@lforst lforst merged commit 65cd080 into master Jan 4, 2023
@lforst lforst deleted the lforst-react-router-draft branch January 4, 2023 08:31
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.

[React Router] Transaction unexpectedly ended early, cancelling spans from componentDidMount()
3 participants