Skip to content

Commit 2566c11

Browse files
antonisclaude
andauthored
fix(ios): Guard replay postInit behind runtime session replay check (#5858)
* fix(ios): Guard replay postInit behind runtime session replay check When iOS deployment target >= 16.0, SENTRY_TARGET_REPLAY_SUPPORTED is true at compile time, but postInit was called unconditionally even when session replay was not configured. This caused a SIGABRT crash on launch in release builds with New Architecture (TurboModules) because the breadcrumb converter installed by postInit referenced a nil replay instance. Fixes #5679 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(ios): Add changelog entry for replay postInit guard Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fixes lint issue --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9d49612 commit 2566c11

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
### Fixes
1212

13+
- Fix SIGABRT crash on launch when `mobileReplayIntegration` is not configured and iOS deployment target >= 16.0 ([#5858](https://github.com/getsentry/sentry-react-native/pull/5858))
1314
- Reduce `reactNavigationIntegration` performance overhead ([#5840](https://github.com/getsentry/sentry-react-native/pull/5840), [#5842](https://github.com/getsentry/sentry-react-native/pull/5842), [#5849](https://github.com/getsentry/sentry-react-native/pull/5849))
1415
- Fix duplicated breadcrumbs on Android ([#5841](https://github.com/getsentry/sentry-react-native/pull/5841))
1516

packages/core/ios/RNSentryStart.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ + (void)startWithOptions:(SentryOptions *)options NS_SWIFT_NAME(start(options:))
2929
[SentrySDK startWithOptions:options];
3030

3131
#if SENTRY_TARGET_REPLAY_SUPPORTED
32-
[RNSentryReplay postInit];
32+
if (options.sessionReplay.sessionSampleRate > 0
33+
|| options.sessionReplay.onErrorSampleRate > 0) {
34+
[RNSentryReplay postInit];
35+
}
3336
#endif
3437

3538
[self postDidBecomeActiveNotification];

0 commit comments

Comments
 (0)