You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support runtime environment changes via scope (sync to native Scope.setEnvironment) #6991
sentry-java 8.63.0 added Scope.setEnvironment/getEnvironment (sentry-java#5772, proposal sentry-java#5769). It is applied to events, the DSC, logs, metrics and profiles. sentry-cocoa already has -[SentryScope setEnvironment:], and sentry-native has sentry_set_environment.
Problem
In RN, environment can only be set at init (options.environment). That value goes to native once, in RNSentryStart and on iOS. If an app changes environment at runtime, native-captured events (native crashes, ANRs, app-exit/NDK events, native logs and profiles) keep the init-time value.
Blocker
JS @sentry/core's Scope has no environment API, so there's nothing on the JS side to sync over the bridge.
Proposal
Upstream: ask sentry-javascript for a scope-level setEnvironment (or find out whether they plan one).
Once that exists: sync it to native through the scope-sync path on both platforms (Android Scope.setEnvironment, iOS SentryScope setEnvironment:), on both architectures. This adds a bridge spec method, so it needs a fallback for older native binaries.
Activity
linear-code commentedon Nov 5, 2026
RN-846