Skip to content

fix(nextjs): Use domains to prevent scope bleed on backend #3574

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

Merged
merged 1 commit into from
May 20, 2021

Conversation

lobsterkatie
Copy link
Member

Prior to this PR, every request to the backend was handled in the same global scope, causing all concurrent requests to share the same hub/scope/etc, with predictably bad consequences (in this case, primarily spans and errors getting associated with the wrong transactions, but the problems would extend to any data stored on the scope which is different for each request).

This PR surrounds everything in our wrapped version of the request handler in a domain, thereby isolating each request's global scope.

@lobsterkatie lobsterkatie requested a review from kamilogorek as a code owner May 20, 2021 01:20
@github-actions
Copy link
Contributor

github-actions bot commented May 20, 2021

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 20.76 KB (+0.01% 🔺)
@sentry/browser - Webpack 21.98 KB (0%)
@sentry/react - Webpack 22.01 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.16 KB (+0.01% 🔺)

@lobsterkatie lobsterkatie force-pushed the kmclb-nextjs-no-scope-bleed branch from d84a4bb to c3e5ecc Compare May 20, 2021 01:42
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

A comment not related to the current changes, but something I noticed while reading the code. Feel free to resolve and come back to it later though (as it's technically out of scope for this patch).

@lobsterkatie lobsterkatie merged commit da07ea7 into kmclb-next-js-performance May 20, 2021
@lobsterkatie lobsterkatie deleted the kmclb-nextjs-no-scope-bleed branch May 20, 2021 18:13
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