Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
});
```

### Fixes

- Apply `Sentry.Mask` and `Sentry.Unmask` on iOS when you start a replay manually with both replay sample rates at `0` ([#7008](https://github.com/getsentry/sentry-react-native/pull/7008))

### Dependencies

- Bump Android SDK from v8.62.0 to v8.63.0 ([#6990](https://github.com/getsentry/sentry-react-native/pull/6990))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,23 @@ - (void)testStartWithDictionaryRemovesPerformanceProperties
// Tracing is disabled by setting tracesSampleRate and tracesSampler to nil
}

- (void)testStartRunsReplayPostInitWhenSampleRatesAreZero
{
id replayMock = OCMClassMock([RNSentryReplay class]);
NSError *error = nil;

NSDictionary *_Nonnull mockedReactNativeDictionary = @{
@"dsn" : @"https://abcd@efgh.ingest.sentry.io/123456",
@"replaysSessionSampleRate" : @0,
@"replaysOnErrorSampleRate" : @0,
};
[RNSentryStart startWithOptions:mockedReactNativeDictionary error:&error];

XCTAssertNil(error);
OCMVerify(ClassMethod([replayMock postInit]));
[replayMock stopMocking];
}

- (void)testStartCaptureFailedRequestsIsDisabled
{
NSError *error = nil;
Expand Down
6 changes: 2 additions & 4 deletions packages/core/ios/RNSentryStart.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ + (void)startWithOptions:(SentryOptions *)options jsSdkVersion:(NSString *_Nulla
[SentrySDK startWithOptions:options];

#if SENTRY_TARGET_REPLAY_SUPPORTED
if (options.sessionReplay.sessionSampleRate > 0
|| options.sessionReplay.onErrorSampleRate > 0) {
[RNSentryReplay postInit];
}
// Replay can start manually with both sample rates at 0, so always register the RN classes.
[RNSentryReplay postInit];
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
#endif

[self postDidBecomeActiveNotification];
Expand Down
Loading