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

int user id causes "Value for id cannot be cast from double to string" in sendEvent #695

Closed
3 of 7 tasks
lobsterkatie opened this issue Oct 15, 2019 · 1 comment · Fixed by #749
Closed
3 of 7 tasks

Comments

@lobsterkatie
Copy link
Member

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native 1.0.9
  • react-native-sentry

react-native version: 0.61.2

Init Code:

Sentry.init({
  dsn: 'https://xxxxxx@sentry.io/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: 'maisey@dogsrule.com'});
});

I have following issue:

Setting my user id as an int rather than a string causes sendEvent to crash.

Steps to reproduce:
See above where I set the user id - it's 26, not "26", and sending events crashes.

Actual result:

image

Expected result:
Casting is handled gracefully and id comes through as a stringified version of its int value.

@lobsterkatie lobsterkatie changed the title sendEvent throws "Value for id cannot be cast from double to string" int user id causes "Value for id cannot be cast from double to string" in sendEvent Oct 15, 2019
@dapicester
Copy link

I bumped into this too. Casting id to String fixed it but I guess this could be done automatically.

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.

2 participants