diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a6142af0..98544df40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ - Return `lastEventId` export from `@sentry/core` ([#4315](https://github.com/getsentry/sentry-react-native/pull/4315)) - Don't log file not found errors when loading envs in `sentry-expo-upload-sourcemaps` ([#4332](https://github.com/getsentry/sentry-react-native/pull/4332)) - Navigation Span should have no parent by default ([#4326](https://github.com/getsentry/sentry-react-native/pull/4326)) +- Disable HTTP Client Errors on iOS ([#4347](https://github.com/getsentry/sentry-react-native/pull/4347)) ### Changes diff --git a/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.mm b/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.mm index df720ee1a..6e63793b8 100644 --- a/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.mm +++ b/packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.mm @@ -38,6 +38,22 @@ - (void)testCreateOptionsWithDictionaryRemovesPerformanceProperties XCTAssertEqual(actualOptions.enableTracing, false, @"EnableTracing should not be passed to native"); } +- (void)testCaptureFailedRequestsIsDisabled +{ + RNSentry *rnSentry = [[RNSentry alloc] init]; + NSError *error = nil; + + NSDictionary *_Nonnull mockedReactNativeDictionary = @{ + @"dsn" : @"https://abcd@efgh.ingest.sentry.io/123456", + }; + SentryOptions *actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary + error:&error]; + + XCTAssertNotNil(actualOptions, @"Did not create sentry options"); + XCTAssertNil(error, @"Should not pass no error"); + XCTAssertFalse(actualOptions.enableCaptureFailedRequests); +} + - (void)testCreateOptionsWithDictionaryNativeCrashHandlingDefault { RNSentry *rnSentry = [[RNSentry alloc] init]; diff --git a/packages/core/ios/RNSentry.mm b/packages/core/ios/RNSentry.mm index ab22df9ec..fc4091d22 100644 --- a/packages/core/ios/RNSentry.mm +++ b/packages/core/ios/RNSentry.mm @@ -215,7 +215,7 @@ - (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull) } // Failed requests can only be enabled in one SDK to avoid duplicates - sentryOptions.enableCaptureFailedRequests = @NO; + sentryOptions.enableCaptureFailedRequests = NO; return sentryOptions; }