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

throwOnImmutableMutation when using setUserContext #347

Closed
2 of 5 tasks
trilopin opened this issue Feb 7, 2018 · 2 comments
Closed
2 of 5 tasks

throwOnImmutableMutation when using setUserContext #347

trilopin opened this issue Feb 7, 2018 · 2 comments
Assignees

Comments

@trilopin
Copy link

trilopin commented Feb 7, 2018

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

Output of node -v && npm -v && npm ls --prod --depth=0

v8.9.2
5.5.1
code
├── i18n-js@3.0.3
├── prop-types@15.6.0
├── react@16.2.0
├── react-native@0.52.0
├── react-native-config@0.11.5
├── react-native-contacts@2.0.0
├── react-native-device-info@0.13.0
├── react-native-permissions@1.0.6
├── react-native-sentry@0.32.1
├── react-native-vector-icons@4.5.0
├── react-navigation@1.0.0-beta.27
├── react-redux@5.0.6
├── redux@3.7.2
├── redux-persist@5.5.0
├── redux-thunk@2.2.0
└── sendbird@3.0.51

Config:

Sentry.config('https://...@sentry.io/...',).install()

I have following issue:

When I use setUserContextmethod and try to fill one textinput I get You attempted to set the key 'field' with the value' content' on an object that is meant to be immutable and has been frozen with app:///index.delta in throwOnImmutableMutation.

I use the method like it's shown in https://docs.sentry.io/clients/react-native/config/.

  const { user: { user } } = store.getState();
  const unauthID = 'unauth-' + getUniqueID();
  Sentry.config(Config.SENTRY_TRACK_URL).install();
  Sentry.setTagsContext({ environment: Config.APP_ENV });
  Sentry.setUserContext({
    id: user.id ? user.id : unauthID,
    username: user.name,
    email: user.email,
    extra: user,
  });

if I remove setUserContext call, app runs ok.
It also happened when I tried to use captureBreadcrumbs

Steps to reproduce:

  • start app,
  • first screen is showed
  • fill field with content
  • press button to continue

Actual result:

  • nothing happens in app
  • in sentry appears the error and user data is tracked correctly.

Expected result:

  • dispatch data to redux and navigate to next screen

Thanks!

@trilopin
Copy link
Author

any extra info is needed? Thanks

@trilopin
Copy link
Author

thank you @HazAT !

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

2 participants