Skip to content

Commit 185e909

Browse files
authored
Merge branch 'v8' into antonis/cocoa-9.1.1
2 parents 446adfb + f18fe11 commit 185e909

File tree

18 files changed

+349
-111
lines changed

18 files changed

+349
-111
lines changed

.claude/settings.json

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(ls:*)",
5+
"Bash(pwd:*)",
6+
"Bash(file:*)",
7+
"Bash(stat:*)",
8+
"Bash(wc:*)",
9+
"Bash(head:*)",
10+
"Bash(tail:*)",
11+
"Bash(cat:*)",
12+
"Bash(tree:*)",
13+
"Bash(find:*)",
14+
"Bash(git status:*)",
15+
"Bash(git log:*)",
16+
"Bash(git diff:*)",
17+
"Bash(git show:*)",
18+
"Bash(git branch:*)",
19+
"Bash(git remote:*)",
20+
"Bash(git tag:*)",
21+
"Bash(git stash list:*)",
22+
"Bash(git rev-parse:*)",
23+
"Bash(git fetch:*)",
24+
"Bash(git ls-files:*)",
25+
"Bash(git blame:*)",
26+
"Bash(gh pr view:*)",
27+
"Bash(gh pr list:*)",
28+
"Bash(gh pr checks:*)",
29+
"Bash(gh pr diff:*)",
30+
"Bash(gh issue view:*)",
31+
"Bash(gh issue list:*)",
32+
"Bash(gh run view:*)",
33+
"Bash(gh run list:*)",
34+
"Bash(gh run logs:*)",
35+
"Bash(gh repo view:*)",
36+
"Bash(gh api:*)",
37+
"Bash(yarn --version:*)",
38+
"Bash(yarn install:*)",
39+
"Bash(yarn build:*)",
40+
"Bash(yarn test:*)",
41+
"Bash(yarn lint:*)",
42+
"Bash(yarn fix:*)",
43+
"Bash(npm --version:*)",
44+
"Bash(node --version:*)",
45+
"Bash(npx --version:*)",
46+
"Bash(npx expo prebuild)",
47+
"Bash(react-native --version:*)",
48+
"Bash(metro --version:*)",
49+
"Bash(jest --version:*)",
50+
"Bash(tsc --version:*)",
51+
"Bash(typescript --version:*)",
52+
"Bash(make --version:*)",
53+
"Bash(make -n:*)",
54+
"Bash(make help:*)",
55+
"Bash(xcodebuild -version:*)",
56+
"Bash(xcodebuild -showsdks:*)",
57+
"Bash(xcodebuild -list:*)",
58+
"Bash(xcrun --version:*)",
59+
"Bash(xcrun --find:*)",
60+
"Bash(xcrun --show-sdk-path:*)",
61+
"Bash(swift --version:*)",
62+
"Bash(swiftc --version:*)",
63+
"Bash(pod --version:*)",
64+
"Bash(pod list:*)",
65+
"Bash(pod search:*)",
66+
"Bash(ruby --version:*)",
67+
"Bash(bundle --version:*)",
68+
"Bash(bundle list:*)",
69+
"Bash(bundle info:*)",
70+
"Bash(bundle show:*)",
71+
"Bash(swiftlint version:*)",
72+
"Bash(python --version:*)",
73+
"Bash(python3 --version:*)",
74+
"Bash(clang-format --version:*)",
75+
"Bash(rbenv --version:*)",
76+
"Bash(rbenv versions:*)",
77+
"Bash(brew --version:*)",
78+
"Bash(brew list:*)",
79+
"Bash(brew info:*)",
80+
"Bash(fastlane --version:*)",
81+
"Bash(slather version:*)",
82+
"Bash(carthage version:*)",
83+
"Bash(./gradlew --version:*)",
84+
"Bash(./gradlew tasks:*)",
85+
"Bash(./gradlew assembleRelease)",
86+
"Bash(gradle --version:*)",
87+
"Bash(java -version:*)",
88+
"Bash(javac -version:*)",
89+
"Bash(kotlinc -version:*)",
90+
"Bash(ktlint --version:*)",
91+
"Bash(lerna --version:*)",
92+
"Bash(lerna list:*)",
93+
"Bash(lerna changed:*)",
94+
"Skill(sentry-skills:code-review)",
95+
"Skill(sentry-skills:find-bugs)",
96+
"Skill(sentry-skills:deslop)",
97+
"Skill(sentry-skills:iterate-pr)",
98+
"Skill(sentry-skills:claude-settings-audit)",
99+
"Skill(sentry-skills:agents-md)",
100+
"WebFetch(domain:docs.sentry.io)",
101+
"WebFetch(domain:develop.sentry.dev)",
102+
"WebFetch(domain:docs.github.com)",
103+
"WebFetch(domain:cli.github.com)",
104+
"WebFetch(domain:developer.apple.com)",
105+
"WebFetch(domain:swift.org)",
106+
"WebFetch(domain:cocoapods.org)",
107+
"WebFetch(domain:guides.cocoapods.org)",
108+
"WebFetch(domain:reactnative.dev)",
109+
"WebFetch(domain:expo.dev)",
110+
"WebFetch(domain:nodejs.org)",
111+
"WebFetch(domain:typescriptlang.org)"
112+
],
113+
"deny": []
114+
}
115+
}

.github/workflows/skip-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
if: steps.check-pr.outputs.is-pr == 'true'
4646
id: check_diff
4747
run: |
48-
skipList=(".github/CODEOWNERS" ".prettierignore" ".github/workflows/update-deps.yml" ".github/workflows/skip-ci.yml")
48+
skipList=(".github/CODEOWNERS" ".prettierignore" ".github/workflows/update-deps.yml" ".github/workflows/skip-ci.yml" ".claude/settings.json")
4949
skipRegList=("(.*/)?\.gitignore" "\.github/ISSUE_TEMPLATE.*")
5050
5151
for s in "${skipRegList[@]}"; do

CHANGELOG.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,31 @@
1010

1111
### Fixes
1212

13+
- Fix duplicate error reporting on iOS with New Architecture ([#5532](https://github.com/getsentry/sentry-react-native/pull/5532))
1314
- Fix for missing `replay_id` from metrics ([#5483](https://github.com/getsentry/sentry-react-native/pull/5483))
1415
- Skip span ID check when standalone mode is enabled ([#5493](https://github.com/getsentry/sentry-react-native/pull/5493))
16+
- Fix traces not always being attached to replays with errors ([#5538](https://github.com/getsentry/sentry-react-native/pull/5538))
1517

1618
### Dependencies
1719

1820
- Bump Cocoa SDK from v8.58.0 to v9.1.0 ([#5356](https://github.com/getsentry/sentry-react-native/pull/5356))
1921
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#910)
2022
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.58.0...9.1.0)
21-
- Bump JavaScript SDK from v10.30.0 to v10.33.0 ([#5480](https://github.com/getsentry/sentry-react-native/pull/5480), [#5487](https://github.com/getsentry/sentry-react-native/pull/5487), [#5496](https://github.com/getsentry/sentry-react-native/pull/5496), [#5522](https://github.com/getsentry/sentry-react-native/pull/5522))
22-
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#10330)
23-
- [diff](https://github.com/getsentry/sentry-javascript/compare/10.30.0...10.33.0)
23+
- Bump JavaScript SDK from v10.30.0 to v10.34.0 ([#5480](https://github.com/getsentry/sentry-react-native/pull/5480), [#5487](https://github.com/getsentry/sentry-react-native/pull/5487), [#5496](https://github.com/getsentry/sentry-react-native/pull/5496), [#5522](https://github.com/getsentry/sentry-react-native/pull/5522), [#5535](https://github.com/getsentry/sentry-react-native/pull/5535))
24+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#10340)
25+
- [diff](https://github.com/getsentry/sentry-javascript/compare/10.30.0...10.34.0)
2426
- Bump CLI from v2.58.4 to v3.1.0 ([#5523](https://github.com/getsentry/sentry-react-native/pull/5523), [#5471](https://github.com/getsentry/sentry-react-native/pull/5471), [#5514](https://github.com/getsentry/sentry-react-native/pull/5514), [#5502](https://github.com/getsentry/sentry-react-native/pull/5502))
2527
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#310)
2628
- [diff](https://github.com/getsentry/sentry-cli/compare/2.58.4...3.1.0)
29+
- Bump Bundler Plugins from v4.6.1 to v4.6.2 ([#5536](https://github.com/getsentry/sentry-react-native/pull/5536))
30+
- [changelog](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/main/CHANGELOG.md#462)
31+
- [diff](https://github.com/getsentry/sentry-javascript-bundler-plugins/compare/4.6.1...4.6.2)
32+
- Bump Android SDK from v8.29.0 to v8.30.0 ([#5539](https://github.com/getsentry/sentry-react-native/pull/5539))
33+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8300)
34+
- [diff](https://github.com/getsentry/sentry-java/compare/8.29.0...8.30.0)
35+
- Bump Android SDK Stubs from v8.29.0 to v8.30.0 ([#5540](https://github.com/getsentry/sentry-react-native/pull/5540))
36+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8300)
37+
- [diff](https://github.com/getsentry/sentry-java/compare/8.29.0...8.30.0)
2738

2839
## 7.8.0
2940

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

dev-packages/e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"devDependencies": {
1414
"@babel/preset-env": "^7.25.3",
1515
"@babel/preset-typescript": "^7.18.6",
16-
"@sentry/core": "10.33.0",
16+
"@sentry/core": "10.34.0",
1717
"@sentry/react-native": "7.8.0",
1818
"@types/node": "^20.9.3",
1919
"@types/react": "^18.2.64",

packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,80 @@ - (void)testIgnoreErrorsRegexAndStringBothWork
768768
XCTAssertNotNil(result3, @"Event with non-matching error should not be dropped");
769769
}
770770

771+
- (void)testBeforeSendFiltersOutUnhandledJSException
772+
{
773+
RNSentry *rnSentry = [[RNSentry alloc] init];
774+
NSError *error = nil;
775+
NSMutableDictionary *mockedOptions = [@{
776+
@"dsn" : @"https://abc@def.ingest.sentry.io/1234567",
777+
} mutableCopy];
778+
mockedOptions = [rnSentry prepareOptions:mockedOptions];
779+
SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedOptions
780+
isSessionReplayEnabled:NO
781+
error:&error];
782+
XCTAssertNotNil(options);
783+
XCTAssertNil(error);
784+
785+
SentryEvent *event = [[SentryEvent alloc] init];
786+
SentryException *exception = [SentryException alloc];
787+
exception.type = @"Unhandled JS Exception";
788+
exception.value = @"Error: Test error";
789+
event.exceptions = @[ exception ];
790+
SentryEvent *result = options.beforeSend(event);
791+
XCTAssertNil(result, @"Event with Unhandled JS Exception should be dropped");
792+
}
793+
794+
- (void)testBeforeSendFiltersOutJSErrorCppException
795+
{
796+
RNSentry *rnSentry = [[RNSentry alloc] init];
797+
NSError *error = nil;
798+
NSMutableDictionary *mockedOptions = [@{
799+
@"dsn" : @"https://abc@def.ingest.sentry.io/1234567",
800+
} mutableCopy];
801+
mockedOptions = [rnSentry prepareOptions:mockedOptions];
802+
SentryOptions *options = [SentrySDKWrapper createOptionsWithDictionary:mockedOptions
803+
isSessionReplayEnabled:NO
804+
error:&error];
805+
XCTAssertNotNil(options);
806+
XCTAssertNil(error);
807+
808+
// Test C++ exception with ExceptionsManager.reportException in value (actual format from New
809+
// Architecture) The exception type is "C++ Exception" and the value contains the mangled name
810+
// and error message
811+
SentryEvent *event1 = [[SentryEvent alloc] init];
812+
SentryException *exception1 = [SentryException alloc];
813+
exception1.type = @"C++ Exception";
814+
exception1.value = @"N8facebook3jsi7JSErrorE: ExceptionsManager.reportException raised an "
815+
@"exception: Unhandled JS Exception: Error: Test error";
816+
event1.exceptions = @[ exception1 ];
817+
SentryEvent *result1 = options.beforeSend(event1);
818+
XCTAssertNil(
819+
result1, @"Event with ExceptionsManager.reportException in value should be dropped");
820+
821+
// Test exception value containing ExceptionsManager.reportException (alternative format)
822+
SentryEvent *event2 = [[SentryEvent alloc] init];
823+
SentryException *exception2 = [SentryException alloc];
824+
exception2.type = @"SomeOtherException";
825+
exception2.value = @"ExceptionsManager.reportException raised an exception: Unhandled JS "
826+
@"Exception: Error: Test";
827+
event2.exceptions = @[ exception2 ];
828+
SentryEvent *result2 = options.beforeSend(event2);
829+
XCTAssertNil(
830+
result2, @"Event with ExceptionsManager.reportException in value should be dropped");
831+
832+
// Test that legitimate C++ exceptions without ExceptionsManager.reportException are not
833+
// filtered
834+
SentryEvent *event3 = [[SentryEvent alloc] init];
835+
SentryException *exception3 = [SentryException alloc];
836+
exception3.type = @"C++ Exception";
837+
exception3.value = @"std::runtime_error: Some other C++ error occurred";
838+
event3.exceptions = @[ exception3 ];
839+
SentryEvent *result3 = options.beforeSend(event3);
840+
XCTAssertNotNil(result3,
841+
@"Legitimate C++ exception without ExceptionsManager.reportException should not be "
842+
@"dropped");
843+
}
844+
771845
- (void)testCreateOptionsWithDictionaryEnableSessionReplayInUnreliableEnvironmentDefault
772846
{
773847
NSError *error = nil;

packages/core/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ android {
5555
dependencies {
5656
compileOnly files('libs/replay-stubs.jar')
5757
implementation 'com.facebook.react:react-native:+'
58-
api 'io.sentry:sentry-android:8.29.0'
58+
api 'io.sentry:sentry-android:8.30.0'
5959
}
0 Bytes
Binary file not shown.

packages/core/android/replay-stubs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ tasks.named('jar', Jar) {
1818
}
1919

2020
dependencies {
21-
compileOnly 'io.sentry:sentry:8.29.0'
21+
compileOnly 'io.sentry:sentry:8.30.0'
2222
}

packages/core/ios/RNSentry.mm

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,19 @@ - (NSMutableDictionary *)prepareOptions:(NSDictionary *)options
9494
return nil;
9595
}
9696

97+
// With New Architecture, React Native wraps JS errors in C++ exceptions.
98+
// These exceptions are caught by the native crash handler and should be filtered out
99+
// since the JS error is already reported by the JS error handler.
100+
// The key indicator is "ExceptionsManager.reportException" in the exception value,
101+
// which is React Native's mechanism for reporting JS errors to the native layer.
102+
for (SentryException *exception in event.exceptions) {
103+
if (nil != exception.value &&
104+
[exception.value rangeOfString:@"ExceptionsManager.reportException"].location
105+
!= NSNotFound) {
106+
return nil;
107+
}
108+
}
109+
97110
// Regex and Str are set when one of them has value so we only need to check one of them.
98111
if (self->_ignoreErrorPatternsStr || self->_ignoreErrorPatternsRegex) {
99112
for (SentryException *exception in event.exceptions) {

0 commit comments

Comments
 (0)