diff --git a/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m b/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m index a15639423b..c2f3ad5ad6 100644 --- a/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m +++ b/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m @@ -33,9 +33,7 @@ - (void)testCreateOptionsWithDictionaryRemovesPerformanceProperties ; mockedReactNativeDictionary = [rnSentry prepareOptions:mockedReactNativeDictionary]; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); @@ -56,9 +54,7 @@ - (void)testCaptureFailedRequestsIsDisabled @"dsn" : @"https://abcd@efgh.ingest.sentry.io/123456", }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); @@ -73,9 +69,7 @@ - (void)testCreateOptionsWithDictionaryNativeCrashHandlingDefault @"dsn" : @"https://abcd@efgh.ingest.sentry.io/123456", }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); XCTAssertTrue(actualOptions.enableCrashHandler, @"Did not set native crash handling"); @@ -89,9 +83,7 @@ - (void)testCreateOptionsWithDictionaryAutoPerformanceTracingDefault @"dsn" : @"https://abcd@efgh.ingest.sentry.io/123456", }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); XCTAssertEqual( @@ -107,9 +99,7 @@ - (void)testCreateOptionsWithDictionaryNativeCrashHandlingEnabled @"enableNativeCrashHandling" : @YES, }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); XCTAssertTrue(actualOptions.enableCrashHandler, @"Did not set native crash handling"); @@ -124,9 +114,7 @@ - (void)testCreateOptionsWithDictionaryAutoPerformanceTracingEnabled @"enableAutoPerformanceTracing" : @YES, }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); XCTAssertEqual( @@ -142,9 +130,7 @@ - (void)testCreateOptionsWithDictionaryNativeCrashHandlingDisabled @"enableNativeCrashHandling" : @NO, }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); XCTAssertFalse(actualOptions.enableCrashHandler, @"Did not disable native crash handling"); @@ -159,9 +145,7 @@ - (void)testCreateOptionsWithDictionaryAutoPerformanceTracingDisabled @"enableAutoPerformanceTracing" : @NO, }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); XCTAssertEqual(actualOptions.enableAutoPerformanceTracing, false, @@ -178,9 +162,7 @@ - (void)testCreateOptionsWithDictionarySpotlightEnabled @"defaultSidecarUrl" : @"http://localhost:8969/teststream", }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); XCTAssertTrue(actualOptions.enableSpotlight, @"Did not enable spotlight"); @@ -197,9 +179,7 @@ - (void)testCreateOptionsWithDictionarySpotlightOne @"defaultSidecarUrl" : @"http://localhost:8969/teststream", }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); XCTAssertTrue(actualOptions.enableSpotlight, @"Did not enable spotlight"); @@ -215,9 +195,7 @@ - (void)testCreateOptionsWithDictionarySpotlightUrl @"spotlight" : @"http://localhost:8969/teststream", }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); XCTAssertTrue(actualOptions.enableSpotlight, @"Did not enable spotlight"); @@ -233,9 +211,7 @@ - (void)testCreateOptionsWithDictionarySpotlightDisabled @"spotlight" : @NO, }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); XCTAssertFalse(actualOptions.enableSpotlight, @"Did not disable spotlight"); @@ -250,9 +226,7 @@ - (void)testCreateOptionsWithDictionarySpotlightZero @"spotlight" : @0, }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); XCTAssertFalse(actualOptions.enableSpotlight, @"Did not disable spotlight"); @@ -269,9 +243,7 @@ - (void)testCreateOptionsWithDictionaryEnableUnhandledCPPExceptionsV2Enabled }, }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); @@ -296,9 +268,7 @@ - (void)testCreateOptionsWithDictionaryEnableUnhandledCPPExceptionsV2Disabled }, }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); @@ -320,9 +290,7 @@ - (void)testCreateOptionsWithDictionaryEnableUnhandledCPPExceptionsV2Default @"dsn" : @"https://abcd@efgh.ingest.sentry.io/123456", }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); @@ -346,9 +314,7 @@ - (void)testCreateOptionsWithDictionaryEnableLogsEnabled @"enableLogs" : @YES, }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); @@ -366,9 +332,7 @@ - (void)testCreateOptionsWithDictionaryEnableLogsDisabled @"enableLogs" : @NO, }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNotNil(actualOptions, @"Did not create sentry options"); XCTAssertNil(error, @"Should not pass no error"); @@ -384,9 +348,7 @@ - (void)testPassesErrorOnWrongDsn @"dsn" : @"not_a_valid_dsn", }; SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; + [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; XCTAssertNil(actualOptions, @"Created invalid sentry options"); XCTAssertNotNil(error, @"Did not created error on invalid dsn"); @@ -403,7 +365,6 @@ - (void)testBeforeBreadcrumbsCallbackFiltersOutSentryDsnRequestBreadcrumbs }; mockedDictionary = [rnSentry prepareOptions:mockedDictionary]; SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedDictionary - isSessionReplayEnabled:NO error:&error]; SentryBreadcrumb *breadcrumb = [[SentryBreadcrumb alloc] init]; breadcrumb.type = @"http"; @@ -423,7 +384,6 @@ - (void)testBeforeBreadcrumbsCallbackFiltersOutDevServerRequestBreadcrumbs NSDictionary *_Nonnull mockedDictionary = @{ @"dsn" : @"https://abc@def.ingest.sentry.io/1234567", @"devServerUrl" : mockDevServer }; SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedDictionary - isSessionReplayEnabled:NO error:&error]; SentryBreadcrumb *breadcrumb = [[SentryBreadcrumb alloc] init]; breadcrumb.type = @"http"; @@ -443,7 +403,6 @@ - (void)testBeforeBreadcrumbsCallbackDoesNotFiltersOutNonDevServerOrDsnRequestBr @"devServerUrl" : @"http://localhost:8081" }; SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedDictionary - isSessionReplayEnabled:NO error:&error]; SentryBreadcrumb *breadcrumb = [[SentryBreadcrumb alloc] init]; breadcrumb.type = @"http"; @@ -462,7 +421,6 @@ - (void)testBeforeBreadcrumbsCallbackKeepsBreadcrumbWhenDevServerUrlIsNotPassedA @"dsn" : @"https://abc@def.ingest.sentry.io/1234567" }; SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedDictionary - isSessionReplayEnabled:NO error:&error]; SentryBreadcrumb *breadcrumb = [[SentryBreadcrumb alloc] init]; breadcrumb.type = @"http"; @@ -650,7 +608,6 @@ - (void)testIgnoreErrorsDropsMatchingExceptionValue } mutableCopy]; mockedOptions = [rnSentry prepareOptions:mockedOptions]; SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedOptions - isSessionReplayEnabled:NO error:&error]; XCTAssertNotNil(options); XCTAssertNil(error); @@ -672,7 +629,6 @@ - (void)testIgnoreErrorsDropsMatchingEventMessage } mutableCopy]; mockedOptions = [rnSentry prepareOptions:mockedOptions]; SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedOptions - isSessionReplayEnabled:NO error:&error]; XCTAssertNotNil(options); XCTAssertNotNil(options); @@ -695,7 +651,6 @@ - (void)testIgnoreErrorsDoesNotDropNonMatchingEvent } mutableCopy]; mockedOptions = [rnSentry prepareOptions:mockedOptions]; SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedOptions - isSessionReplayEnabled:NO error:&error]; XCTAssertNotNil(options); XCTAssertNotNil(options); @@ -721,7 +676,6 @@ - (void)testIgnoreErrorsDropsMatchingExactString } mutableCopy]; mockedOptions = [rnSentry prepareOptions:mockedOptions]; SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedOptions - isSessionReplayEnabled:NO error:&error]; XCTAssertNotNil(options); XCTAssertNotNil(options); @@ -746,7 +700,6 @@ - (void)testIgnoreErrorsRegexAndStringBothWork } mutableCopy]; mockedOptions = [rnSentry prepareOptions:mockedOptions]; SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedOptions - isSessionReplayEnabled:NO error:&error]; XCTAssertNotNil(options); XCTAssertNotNil(options); @@ -783,7 +736,6 @@ - (void)testBeforeSendFiltersOutUnhandledJSException } mutableCopy]; mockedOptions = [rnSentry prepareOptions:mockedOptions]; SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedOptions - isSessionReplayEnabled:NO error:&error]; XCTAssertNotNil(options); XCTAssertNil(error); @@ -806,7 +758,6 @@ - (void)testBeforeSendFiltersOutJSErrorCppException } mutableCopy]; mockedOptions = [rnSentry prepareOptions:mockedOptions]; SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedOptions - isSessionReplayEnabled:NO error:&error]; XCTAssertNotNil(options); XCTAssertNil(error); @@ -848,138 +799,6 @@ - (void)testBeforeSendFiltersOutJSErrorCppException @"dropped"); } -- (void)testCreateOptionsWithDictionaryEnableSessionReplayInUnreliableEnvironmentDefault -{ - NSError *error = nil; - - NSDictionary *_Nonnull mockedReactNativeDictionary = @{ - @"dsn" : @"https://abcd@efgh.ingest.sentry.io/123456", - }; - SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; - - XCTAssertNotNil(actualOptions, @"Did not create sentry options"); - XCTAssertNil(error, @"Should not pass no error"); - - id experimentalOptions = [actualOptions valueForKey:@"experimental"]; - XCTAssertNotNil(experimentalOptions, @"Experimental options should not be nil"); - - BOOL enableUnhandledCPPExceptions = - [[experimentalOptions valueForKey:@"enableSessionReplayInUnreliableEnvironment"] boolValue]; - XCTAssertFalse(enableUnhandledCPPExceptions, - @"enableSessionReplayInUnreliableEnvironment should be disabled"); -} - -- (void)testCreateOptionsWithDictionaryEnableSessionReplayInUnreliableEnvironmentWithErrorSampleRate -{ - NSError *error = nil; - - NSMutableDictionary *_Nonnull mockedReactNativeDictionary = [@{ - @"dsn" : @"https://abcd@efgh.ingest.sentry.io/123456", - @"replaysOnErrorSampleRate" : @1.0, - @"replaysSessionSampleRate" : @0 - } mutableCopy]; - BOOL enableReplay = [RNSentryReplay updateOptions:mockedReactNativeDictionary]; - SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:enableReplay - error:&error]; - - XCTAssertNotNil(actualOptions, @"Did not create sentry options"); - XCTAssertNil(error, @"Should not pass no error"); - - id experimentalOptions = [actualOptions valueForKey:@"experimental"]; - XCTAssertNotNil(experimentalOptions, @"Experimental options should not be nil"); - - BOOL enableUnhandledCPPExceptions = - [[experimentalOptions valueForKey:@"enableSessionReplayInUnreliableEnvironment"] boolValue]; - XCTAssertTrue(enableUnhandledCPPExceptions, - @"enableSessionReplayInUnreliableEnvironment should be enabled"); -} - -- (void) - testCreateOptionsWithDictionaryEnableSessionReplayInUnreliableEnvironmentWithSessionSampleRate -{ - NSError *error = nil; - - NSMutableDictionary *_Nonnull mockedReactNativeDictionary = [@{ - @"dsn" : @"https://abcd@efgh.ingest.sentry.io/123456", - @"replaysOnErrorSampleRate" : @0.0, - @"replaysSessionSampleRate" : @0.1 - } mutableCopy]; - BOOL enableReplay = [RNSentryReplay updateOptions:mockedReactNativeDictionary]; - SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:enableReplay - error:&error]; - XCTAssertNotNil(actualOptions, @"Did not create sentry options"); - XCTAssertNil(error, @"Should not pass no error"); - - id experimentalOptions = [actualOptions valueForKey:@"experimental"]; - XCTAssertNotNil(experimentalOptions, @"Experimental options should not be nil"); - - BOOL enableUnhandledCPPExceptions = - [[experimentalOptions valueForKey:@"enableSessionReplayInUnreliableEnvironment"] boolValue]; - XCTAssertTrue(enableUnhandledCPPExceptions, - @"enableSessionReplayInUnreliableEnvironment should be enabled"); -} - -- (void) - testCreateOptionsWithDictionaryEnableSessionReplayInUnreliableEnvironmentWithSessionSampleRates -{ - NSError *error = nil; - - NSMutableDictionary *_Nonnull mockedReactNativeDictionary = [@{ - @"dsn" : @"https://abcd@efgh.ingest.sentry.io/123456", - @"replaysOnErrorSampleRate" : @1.0, - @"replaysSessionSampleRate" : @0.1 - } mutableCopy]; - BOOL enableReplay = [RNSentryReplay updateOptions:mockedReactNativeDictionary]; - SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:enableReplay - error:&error]; - - XCTAssertNotNil(actualOptions, @"Did not create sentry options"); - XCTAssertNil(error, @"Should not pass no error"); - - id experimentalOptions = [actualOptions valueForKey:@"experimental"]; - XCTAssertNotNil(experimentalOptions, @"Experimental options should not be nil"); - - BOOL enableUnhandledCPPExceptions = - [[experimentalOptions valueForKey:@"enableSessionReplayInUnreliableEnvironment"] boolValue]; - XCTAssertTrue(enableUnhandledCPPExceptions, - @"enableSessionReplayInUnreliableEnvironment should be enabled"); -} - -- (void)testCreateOptionsWithDictionaryEnableSessionReplayInUnreliableEnvironmentDisabled -{ - NSError *error = nil; - - NSDictionary *_Nonnull mockedReactNativeDictionary = @{ - @"dsn" : @"https://abcd@efgh.ingest.sentry.io/123456", - @"replaysOnErrorSampleRate" : @0, - @"replaysSessionSampleRate" : @0 - }; - SentryOptions *actualOptions = - [SentrySDKWrapper createOptionsWithDictionary:mockedReactNativeDictionary - isSessionReplayEnabled:NO - error:&error]; - - XCTAssertNotNil(actualOptions, @"Did not create sentry options"); - XCTAssertNil(error, @"Should not pass no error"); - - id experimentalOptions = [actualOptions valueForKey:@"experimental"]; - XCTAssertNotNil(experimentalOptions, @"Experimental options should not be nil"); - - BOOL enableUnhandledCPPExceptions = - [[experimentalOptions valueForKey:@"enableSessionReplayInUnreliableEnvironment"] boolValue]; - XCTAssertFalse(enableUnhandledCPPExceptions, - @"enableSessionReplayInUnreliableEnvironment should be disabled"); -} - - (void)testCreateUserWithGeoDataCreatesSentryGeoObject { NSDictionary *userKeys = @{ diff --git a/packages/core/ios/RNSentryExperimentalOptions.h b/packages/core/ios/RNSentryExperimentalOptions.h index eece5af374..07f5395665 100644 --- a/packages/core/ios/RNSentryExperimentalOptions.h +++ b/packages/core/ios/RNSentryExperimentalOptions.h @@ -28,15 +28,6 @@ NS_ASSUME_NONNULL_BEGIN */ + (void)setEnableLogs:(BOOL)enabled sentryOptions:(SentryOptions *)sentryOptions; -/** - * Sets the enableSessionReplayInUnreliableEnvironment experimental option on SentryOptions - * @param sentryOptions The SentryOptions instance to configure - * @param enabled Whether enableSessionReplayInUnreliableEnvironment from sentry Cocoa should be - * enabled - */ -+ (void)setEnableSessionReplayInUnreliableEnvironment:(BOOL)enabled - sentryOptions:(SentryOptions *)sentryOptions; - /** * Configures iOS UI profiling options on SentryOptions * @param profilingOptions Dictionary containing profiling configuration diff --git a/packages/core/ios/RNSentryExperimentalOptions.m b/packages/core/ios/RNSentryExperimentalOptions.m index d2f636ca92..c53576254d 100644 --- a/packages/core/ios/RNSentryExperimentalOptions.m +++ b/packages/core/ios/RNSentryExperimentalOptions.m @@ -28,15 +28,6 @@ + (void)setEnableLogs:(BOOL)enabled sentryOptions:(SentryOptions *)sentryOptions sentryOptions.enableLogs = enabled; } -+ (void)setEnableSessionReplayInUnreliableEnvironment:(BOOL)enabled - sentryOptions:(SentryOptions *)sentryOptions -{ - if (sentryOptions == nil) { - return; - } - sentryOptions.experimental.enableSessionReplayInUnreliableEnvironment = enabled; -} - + (void)configureProfilingWithOptions:(NSDictionary *)profilingOptions sentryOptions:(SentryOptions *)sentryOptions { diff --git a/packages/core/ios/RNSentryReplay.h b/packages/core/ios/RNSentryReplay.h index cda7035550..49d61d4b1a 100644 --- a/packages/core/ios/RNSentryReplay.h +++ b/packages/core/ios/RNSentryReplay.h @@ -3,9 +3,8 @@ /** * Updates the session replay options - * @return true when session replay is enabled */ -+ (BOOL)updateOptions:(NSMutableDictionary *)options; ++ (void)updateOptions:(NSMutableDictionary *)options; + (void)postInit; diff --git a/packages/core/ios/RNSentryReplay.mm b/packages/core/ios/RNSentryReplay.mm index 47bac6cdf5..c7adf33ebe 100644 --- a/packages/core/ios/RNSentryReplay.mm +++ b/packages/core/ios/RNSentryReplay.mm @@ -12,14 +12,14 @@ @implementation RNSentryReplay { } -+ (BOOL)updateOptions:(NSMutableDictionary *)options ++ (void)updateOptions:(NSMutableDictionary *)options { NSNumber *sessionSampleRate = options[@"replaysSessionSampleRate"]; NSNumber *errorSampleRate = options[@"replaysOnErrorSampleRate"]; if (sessionSampleRate == nil && errorSampleRate == nil) { NSLog(@"Session replay disabled via configuration"); - return NO; + return; } NSLog(@"Setting up session replay"); @@ -45,8 +45,6 @@ + (BOOL)updateOptions:(NSMutableDictionary *)options @ { @"name" : REACT_NATIVE_SDK_NAME, @"version" : REACT_NATIVE_SDK_PACKAGE_VERSION } } forKey:@"sessionReplay"]; - return (errorSampleRate != nil && [errorSampleRate doubleValue] > 0) - || (sessionSampleRate != nil && [sessionSampleRate doubleValue] > 0); } + (NSArray *_Nonnull)getReplayRNRedactClasses:(NSDictionary *_Nullable)replayOptions diff --git a/packages/core/ios/RNSentryStart.m b/packages/core/ios/RNSentryStart.m index 2542da23b6..6763d2e072 100644 --- a/packages/core/ios/RNSentryStart.m +++ b/packages/core/ios/RNSentryStart.m @@ -44,9 +44,7 @@ + (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull) NSMutableDictionary *mutableOptions = [options mutableCopy]; #if SENTRY_TARGET_REPLAY_SUPPORTED - BOOL isSessionReplayEnabled = [RNSentryReplay updateOptions:mutableOptions]; -#else - BOOL isSessionReplayEnabled = NO; + [RNSentryReplay updateOptions:mutableOptions]; #endif SentryOptions *sentryOptions = [PrivateSentrySDKOnly optionsWithDictionary:mutableOptions @@ -170,11 +168,6 @@ + (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull) } } - if (isSessionReplayEnabled) { - [RNSentryExperimentalOptions setEnableSessionReplayInUnreliableEnvironment:YES - sentryOptions:sentryOptions]; - } - return sentryOptions; } diff --git a/packages/core/ios/SentrySDKWrapper.h b/packages/core/ios/SentrySDKWrapper.h index ce6463d77f..22d184e79c 100644 --- a/packages/core/ios/SentrySDKWrapper.h +++ b/packages/core/ios/SentrySDKWrapper.h @@ -16,12 +16,9 @@ + (void)startWithOptions:(SentryOptions *)options; + (SentryOptions *)createOptionsWithDictionary:(NSDictionary *)options - isSessionReplayEnabled:(BOOL)isSessionReplayEnabled error:(NSError **)errorPointer; -+ (void)setupWithDictionary:(NSDictionary *)options - isSessionReplayEnabled:(BOOL)isSessionReplayEnabled - error:(NSError **)errorPointer; ++ (void)setupWithDictionary:(NSDictionary *)options error:(NSError **)errorPointer; + (BOOL)debug; diff --git a/packages/core/ios/SentrySDKWrapper.m b/packages/core/ios/SentrySDKWrapper.m index 38647527a0..d284d2a2d0 100644 --- a/packages/core/ios/SentrySDKWrapper.m +++ b/packages/core/ios/SentrySDKWrapper.m @@ -31,7 +31,6 @@ + (void)configureScope:(void (^)(SentryScope *scope))callback } + (SentryOptions *)createOptionsWithDictionary:(NSDictionary *)options - isSessionReplayEnabled:(BOOL)isSessionReplayEnabled error:(NSError *__autoreleasing *)errorPointer { NSString *dsn = [self getURLFromDSN:[options valueForKey:@"dsn"]]; @@ -115,10 +114,6 @@ + (SentryOptions *)createOptionsWithDictionary:(NSDictionary *)options } } - if (isSessionReplayEnabled) { - [RNSentryExperimentalOptions setEnableSessionReplayInUnreliableEnvironment:YES - sentryOptions:sentryOptions]; - } return sentryOptions; } @@ -132,12 +127,9 @@ + (NSString *_Nullable)getURLFromDSN:(NSString *)dsn } + (void)setupWithDictionary:(NSDictionary *_Nonnull)options - isSessionReplayEnabled:(BOOL)isSessionReplayEnabled error:(NSError *_Nonnull *_Nonnull)errorPointer { - SentryOptions *sentryOptions = [self createOptionsWithDictionary:options - isSessionReplayEnabled:isSessionReplayEnabled - error:errorPointer]; + SentryOptions *sentryOptions = [self createOptionsWithDictionary:options error:errorPointer]; if (!options) { return; }