sentry-electron
sentry-electron copied to clipboard
Report ANR event that is detect by sentry has no user infos
Is there an existing issue for this?
- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- [X] I have reviewed the documentation https://docs.sentry.io/
- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
4.17.0
Framework Version
No response
Link to Sentry event
https://jupiter-ct.sentry.io/issues/4892881997/?project=1428302&query=&referrer=project-issue-stream&statsPeriod=1h
SDK Setup
Sentry.init({ dsn: sentryUrl, debug: debugMode, maxValueLength: MAX_VALUE_LENGTH, release: releaseVersion, initialScope: this._sentryInitialScope, ... });
Sentry.enableMainProcessAnrDetection({captureStackTrace: true});
Steps to Reproduce
I use Electron sdk of Sentry, on version 4.17.0 and I set userInfo by Sentry.configureScope((scope) => { scope.setUser(sentryUserInfo); // for EU Privacy, update email to Account ID ... }); while login success.
And reproduce steps:
- I open ANR detect by Sentry.enableMainProcessAnrDetection({captureStackTrace: true });
- I mock a ANR on main process;
- I find ANR event, but this event has no user info.
And I mock other sentry report not anr, the report on Sentry.io has userinfos, just ANR Event
Expected Result
ANR event should has user Info
Actual Result
There is no user info
Hey @VictorWangRC thanks for writing in!
@timfish would you mind taking a look at this?
Currently there is no scope synchronization to the ANR process which includes user/tags/extra.
I've opened an issue to track this work in the JavaScript repository since that is where this code lives: https://github.com/getsentry/sentry-javascript/issues/10668
The next v7 release will fix this but you should use the anrIntegration as enableMainProcessAnrDetection has been deprecated:
Sentry.init({
dsn: '__DSN__',
integrations: [Sentry.anrIntegration|({captureStackTrace: true})]
});
This was fixed a few releases ago. It's worth noting that if the event loop remains blocked for more than 5 seconds after ANR is detected, we give up fetching the context.