Skip to content
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

Context values not getting attached to native crashes #694

Closed
4 tasks
lobsterkatie opened this issue Oct 11, 2019 · 11 comments · Fixed by #902
Closed
4 tasks

Context values not getting attached to native crashes #694

lobsterkatie opened this issue Oct 11, 2019 · 11 comments · Fixed by #902

Comments

@lobsterkatie
Copy link
Member

lobsterkatie commented Oct 11, 2019

OS:

  • Windows
  • [X ] MacOS
  • Linux

Platform:

  • [X ] iOS
  • Android

SDK:

  • [X ] @sentry/react-native 1.0.6
  • react-native-sentry

react-native version: 0.61.2

Init Code:

Sentry.init({
  dsn: 'https://[email protected]/xxxxx',
  environment: 'prod',
  attachStacktrace: true,
  debug: true,
});
Sentry.setRelease('friday');

Sentry.configureScope(scope => {
  scope.setTags({dogs: 'yes', cats: 'maybe'});
  scope.setExtras({things: 'stuff'});
  scope.setUser({id: 26, email: '[email protected]'});
});

I have following issue:

None of the values set on the scope come through on native crashes.

Steps to reproduce:
Add context to scope and trigger a native crash.

Actual result:
None of the scope data is displayed:

image

[no image of extra data to show here because it doesn't come through]

Expected result:
Scope data is added to event, as it is for JS events:

image

image

EDIT: Per @HazAT, this applies to breadcrumbs as well.

@HazAT
Copy link
Member

HazAT commented Nov 12, 2019

To add to this, scope.setContext or Sentry.setContext also currently doesn't work.

@anguyen1817
Copy link

I'm experiencing the same issue.

@halilb
Copy link

halilb commented Dec 26, 2019

This is also a huge problem for us. We can't track any tag data on native crashes.

The data coming from beforeSend method is also not sent along with the native crash log.

@mattijsf
Copy link

Same thing for us. We set the user id on the javascript side like this:

Sentry.setUser({ id: AppSettings.deviceLogin })

But there is a difference between native errors / js errors:
Sentry.nativeCrash() = Missing expected user id 👎
Sentry.captureException(new Error("JS Error")) = User id is present and correct 👍

Both these methods are called after Sentry.init & Sentry.setUser.

I would expect these values / tags to be configured on the native crash handlers as well.

@mefjuu
Copy link

mefjuu commented Mar 5, 2020

Do you experience a missing context problem on iOS only? As far as I see the same issue occurs on Android as well.

@jbolter
Copy link

jbolter commented Apr 21, 2020

Any update on this? This makes deciphering native crashes really difficult.

@benanderman
Copy link

Any update on this? This makes deciphering native crashes really difficult.

Also wondering; we've held back on updating to @sentry/react-native because of this, but that means we're pretty out of date.

@ulion
Copy link

ulion commented May 8, 2020

The context should be unified, the context should also be send to native sdk clearly. +1.

@nluetteken
Copy link

nluetteken commented May 20, 2020

Same issue here. Would be really helpful to get it fixed. Exceptions on JS side get recorded fine with breadcrumbs and user data, crashes on the native side are missing breadcrumbs as well as user data (for us iOS as well as Android).

@ajouve
Copy link

ajouve commented Jun 6, 2020

I am testing the following code after sentry init

Sentry.setContext('foo','bar');
Sentry.captureException(new Error('Test sentry error'));

My context is not displayed

In ADDITIONAL DATA I just have undefined values

Screenshot 2020-06-06 at 16 27 37

@jennmueng
Copy link
Member

I am testing the following code after sentry init

Sentry.setContext('foo','bar');
Sentry.captureException(new Error('Test sentry error'));

My context is not displayed

In ADDITIONAL DATA I just have undefined values

Screenshot 2020-06-06 at 16 27 37

@ajouve Sentry.setContext takes an object as a second parameter and not a string:
http://getsentry.github.io/sentry-javascript/classes/hub.scope.html#setcontext

I see that in the docs here we have mistakenly put a string as an example. Is there anywhere else that you got the info from so we can go fix the documentation? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.