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

Passing additional info to setUser displays as unknown #1074

Closed
5 of 11 tasks
StebanDev opened this issue Sep 14, 2020 · 6 comments
Closed
5 of 11 tasks

Passing additional info to setUser displays as unknown #1074

StebanDev opened this issue Sep 14, 2020 · 6 comments

Comments

@StebanDev
Copy link

StebanDev commented Sep 14, 2020

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 1.7.2

react-native version: 0.63.2

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

Link to issue

Configuration:

(@sentry/react-native)

Sentry.init({
  dsn: 'https://[email protected]/...'
  // other options
});

Sentry.configureScope((scope) => {
      scope.setUser({
        id: 101,
        email: '[email protected]',
        name: 'User Hello',
        endpoint: 'companynamex.com',
      })
    })

I have following issue:

Sentry is not displaying user additional info passed with the setUser method.

Steps to reproduce:

  • Init sentry and set a user with additional data
  • Throw an error on RN side

Actual result:

[Actual result]
The additional info is shown together as json with an unknown label
image

Expected result:

I would expect to parse the additional fields as it does on another project

image

@StebanDev StebanDev changed the title Passing additional fields to setUser displays as unknown Passing additional info to setUser displays as unknown Sep 14, 2020
@jennmueng
Copy link
Member

Hi @StebanDev, I reproduced this. This actually occurs on our backend as I checked, the React Native SDK sends the user object with the unknown keys on the same level as the other fields. Do you mind letting me know what SDK your other project uses? Thanks.

@StebanDev
Copy link
Author

Hi @jennmueng, thank you for the quick response. I have checked and it's working fine on 1.3.1 version.

@StebanDev
Copy link
Author

Another thing to notice is that with latest sdk version the user properties are overridden instead of merged, e.g IP Address is not longer showing if not passed as a user field.

@jennmueng
Copy link
Member

@StebanDev Hmm I will investigate this further and get back to you. Thanks!

Also, setUser is intended to be overwrite any existing user object set before. This is because if you have a new user in your app, you would want Sentry.setUser to completely change the stored user. If it was merged before then that must have been a bug.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2021

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@marandaneto
Copy link
Contributor

Closing the issue, as it seems like the original issue has been resolved.
Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it.
Cheers!

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

No branches or pull requests

3 participants