You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call getCurrentScope().setUser({ name, email }) with some details of the authenticated user like the name and email
Call getCurrentScope() immediately after but elsewhere in the code and inspect the _user property of the entire object. it will be out of date.
Call getCurrentScope().getUser() in the same location - the value will be the most recent value and will conflict with _user from step 2.
Initialize the feedbackIntegration() using useSentryUser set to { name: 'name', email: 'email' }. The default feedback dialog will not pre-populate the name and email fields with those properties from the scope because at time of initialization, they didn't get set.
Expected Result
The scope should update immediately everywhere and the properties on the scope object fetched from using getCurrentScope() should match the result of the getUser() method on the scope object itself.
Actual Result
see results of the following code in the screenshot below:
the feedback integration dialog's input values are empty because of this I think
it's really difficult to debug the feedback integration overall though. and its frustrating that you can't set a fallback value or another value for these inputs in the feedback integration constructor function - you're forced to rely on the scope which sucks.
The text was updated successfully, but these errors were encountered:
Okay I think this is a problem with using the current scope here. As Isolation Scope != Current Scope.
The Feedback Integration docs tell you that you should set the user with Sentry.setUser(). All Sentry.setXYZ() methods are set on the isolation scope (see Scope docs).
The "Current Scope" is very short-lived and is forked very often under the hood. That's why you probably have different data between different scopes. So it's recommended to always use the isolation scope with Sentry.setXYZ() methods.
Here is a graphical representation of what the scope-forking looks like if you want to dig deeper into this topic:
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/react
SDK Version
^9.4.0
Framework Version
^17.0.2
Link to Sentry event
n/a
Reproduction Example/SDK Setup
No response
Steps to Reproduce
getCurrentScope().setUser({ name, email })
with some details of the authenticated user like thename
andemail
getCurrentScope()
immediately after but elsewhere in the code and inspect the_user
property of the entire object. it will be out of date.getCurrentScope().getUser()
in the same location - the value will be the most recent value and will conflict with_user
from step 2.feedbackIntegration()
usinguseSentryUser
set to{ name: 'name', email: 'email' }
. The default feedback dialog will not pre-populate the name and email fields with those properties from the scope because at time of initialization, they didn't get set.Expected Result
The scope should update immediately everywhere and the properties on the
scope
object fetched from usinggetCurrentScope()
should match the result of thegetUser()
method on thescope
object itself.Actual Result
see results of the following code in the screenshot below:
the feedback integration dialog's input values are empty because of this I think

it's really difficult to debug the feedback integration overall though. and its frustrating that you can't set a fallback value or another value for these inputs in the feedback integration constructor function - you're forced to rely on the scope which sucks.
The text was updated successfully, but these errors were encountered: