Skip to content

Commit

Permalink
fix(ios): Disable HTTP Client errors in sentry-cocoa to avoid duplica…
Browse files Browse the repository at this point in the history
…tes (#4347)
  • Loading branch information
krystofwoldrich authored Dec 11, 2024
1 parent ddc0552 commit 9385d74
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

### Dependencies

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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://[email protected]/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];
Expand Down
2 changes: 1 addition & 1 deletion packages/core/ios/RNSentry.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9385d74

Please sign in to comment.