Skip to content

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

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

Closed
wants to merge 1 commit into from

Conversation

onurtemizkan
Copy link
Collaborator

Fixes: #6470

Stops finishing active transactions in the second useEffect call (first one only runs on pageload) for pageload transactions.

Instead, skips the second useEffect altogether when the first one runs.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.78 KB (-0.02% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 61.27 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.57 KB (+0.02% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 54.8 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.34 KB (0%)
@sentry/browser - Webpack (minified) 66.48 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.36 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.56 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.75 KB (0%)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.19 KB (-0.01% 🔽)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.08 KB (-0.01% 🔽)
@sentry/replay - Webpack (gzipped + minified) 38.17 KB (0%)

Copy link
Collaborator

@timfish timfish 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 although I lacked the context to fix this myself so probably not the best person to judge!

Maybe add a test to ensure this doesn't regress?

@onurtemizkan
Copy link
Collaborator Author

Closing in favour of #6609

@AbhiPrasad AbhiPrasad deleted the onur/react-router-6-pageload-early-ends branch March 27, 2025 15:51
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()
2 participants