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

fix(rn-options): Create new options object on every init to avoid read only error when initializing multiple times #350

Merged
merged 3 commits into from
Jul 11, 2023

Conversation

krystofwoldrich
Copy link
Contributor

Checklist

Why

How

Because of the use of const DEFAULT_OPTIONS the options key _metadata was shared between multiple instances of Sentry when initialized twice in the same runtime, since Sentry saves default values to the _metadata and later on makes the options read-only the assign would fail the second time.

Test Plan

Sentry.init({...});

Sentry.init({...});

I've simulated the error by running the init multiple times, tho this should not ever be done in a real App. But it happens during the JS reload when the environment stays for example during OTA updates.

@kbrandwijk kbrandwijk merged commit 86f51d1 into expo:main Jul 11, 2023
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 this pull request may close these issues.

Error: You attempted to set the key sdk with the value
2 participants