Skip to content

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

Closed
@lobsterkatie

Description

@lobsterkatie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions