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
- 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:
const scope = getCurrentScope();
console.log(scope, scope.getUser());

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.
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 thenameandemailgetCurrentScope()immediately after but elsewhere in the code and inspect the_userproperty 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_userfrom step 2.feedbackIntegration()usinguseSentryUserset 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
scopeobject fetched from usinggetCurrentScope()should match the result of thegetUser()method on thescopeobject 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.