-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(nextjs): Use domains to prevent scope bleed #3788
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
Conversation
35fa46c
to
3491bfe
Compare
size-limit report
|
Tbh I'm not sure if |
We should think about using async_hooks instead of domains for the next sdk. We can also do it in another PR. |
37e446c
to
d8cf291
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I agree with @AbhiPrasad that it might be a good playground for async_hooks
11df2e6
to
d8cf291
Compare
We were clearing the scope because we were worried that different requests might pollute each other's scopes on the server. Howevever, it looks like Sentry handles this for us, so we don't need to risk blowing away valuable debugging info: getsentry/sentry-javascript#3788
This PR uses domains to keep scope data attached to simultaneous requests from bleeding between those requests. (For example, when testing tracing on API routes deployed to Vercel, in certain cases all transactions were using the same
traceId
, even though the original transaction corresponding to that id had long since finished.)