-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(feedback): Check for empty user #11993
Conversation
if (isolationUser && Object.keys(isolationUser).length) { | ||
return isolationUser; | ||
} | ||
return globalUser; |
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.
Can this also return the empty object?
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.
Yes it can. We want to check all scopes to see if any have been set, and if not, it'll return an empty object. We were using null coalescing before, which didn't work for empty objects, and would return the empty object without checking the other scopes.
size-limit report 📦
|
When getting the user from the scope, the user can also be an empty object, which doesn't work with null coalescing. This checks to see if the user exists and that it's not empty in all scopes Fixes getsentry/sentry#70347
When getting the user from the scope, the user can also be an empty object, which doesn't work with null coalescing. This checks to see if the user exists and that it's not empty in all scopes
Fixes getsentry/sentry#70347