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.
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 theoptions
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.