feat: add sentry_set_release/environment by jpnurmi · Pull Request #1555 · getsentry/sentry-native

@jpnurmi @claude

Add post-init setters for release and environment, allowing apps to
update these values after SDK init without full re-init.

The new values are stored on the scope (like user), keeping options
immutable after init. Sessions pick up the new values when manually
started after calling the setters.

Close: #1516
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

and others added 3 commits

March 5, 2026 18:55
Acquire options lock before scope lock in sentry_set_release_n and
sentry_set_environment_n to match the lock order used by sentry_init
(options → scope), fixing a potential deadlock detected by TSan.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use SENTRY_WITH_SCOPE_MUT instead of _NO_FLUSH so that crashpad
re-serializes its cached crash event when release or environment
changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@jpnurmi jpnurmi marked this pull request as ready for review

March 6, 2026 08:57

@jpnurmi

cursor[bot]

@jpnurmi @claude

`sentry_start_session()` already holds the scope lock, so pass the scope
pointer directly instead of re-acquiring it inside `sentry__session_new()`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

supervacuus

Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com>

@jpnurmi

@jpnurmi jpnurmi deleted the jpnurmi/feat/update-release-env branch

March 9, 2026 14:59