Skip to content

Commit 9385d74

Browse files
fix(ios): Disable HTTP Client errors in sentry-cocoa to avoid duplicates (#4347)
1 parent ddc0552 commit 9385d74

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
- Return `lastEventId` export from `@sentry/core` ([#4315](https://github.com/getsentry/sentry-react-native/pull/4315))
4141
- 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))
4242
- Navigation Span should have no parent by default ([#4326](https://github.com/getsentry/sentry-react-native/pull/4326))
43+
- Disable HTTP Client Errors on iOS ([#4347](https://github.com/getsentry/sentry-react-native/pull/4347))
4344

4445
### Dependencies
4546

packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.mm

+16
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ - (void)testCreateOptionsWithDictionaryRemovesPerformanceProperties
3838
XCTAssertEqual(actualOptions.enableTracing, false, @"EnableTracing should not be passed to native");
3939
}
4040

41+
- (void)testCaptureFailedRequestsIsDisabled
42+
{
43+
RNSentry *rnSentry = [[RNSentry alloc] init];
44+
NSError *error = nil;
45+
46+
NSDictionary *_Nonnull mockedReactNativeDictionary = @{
47+
@"dsn" : @"https://[email protected]/123456",
48+
};
49+
SentryOptions *actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary
50+
error:&error];
51+
52+
XCTAssertNotNil(actualOptions, @"Did not create sentry options");
53+
XCTAssertNil(error, @"Should not pass no error");
54+
XCTAssertFalse(actualOptions.enableCaptureFailedRequests);
55+
}
56+
4157
- (void)testCreateOptionsWithDictionaryNativeCrashHandlingDefault
4258
{
4359
RNSentry *rnSentry = [[RNSentry alloc] init];

packages/core/ios/RNSentry.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ - (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull)
215215
}
216216

217217
// Failed requests can only be enabled in one SDK to avoid duplicates
218-
sentryOptions.enableCaptureFailedRequests = @NO;
218+
sentryOptions.enableCaptureFailedRequests = NO;
219219

220220
return sentryOptions;
221221
}

0 commit comments

Comments
 (0)