Skip to content

Commit bd86de7

Browse files
authored
Merge branch 'main' into antonis/bump-e2e-0.82.0-rc.1
2 parents 6921298 + 8db9631 commit bd86de7

File tree

21 files changed

+327
-197
lines changed

21 files changed

+327
-197
lines changed

.github/workflows/e2e-v2.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414

1515
env:
1616
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
17-
MAESTRO_VERSION: '2.0.5'
17+
MAESTRO_VERSION: '2.0.6'
1818
IOS_DEVICE: 'iPhone 16'
1919
IOS_VERSION: '18.1'
2020

@@ -60,7 +60,7 @@ jobs:
6060
- uses: actions/setup-node@v5
6161
with:
6262
package-manager-cache: false
63-
node-version: 18
63+
node-version: 20
6464
cache: 'yarn'
6565
cache-dependency-path: yarn.lock
6666

@@ -232,7 +232,7 @@ jobs:
232232
- uses: actions/setup-node@v5
233233
with:
234234
package-manager-cache: false
235-
node-version: 18
235+
node-version: 20
236236
cache: 'yarn'
237237
cache-dependency-path: yarn.lock
238238

.github/workflows/sample-application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ concurrency:
1313

1414
env:
1515
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
16-
MAESTRO_VERSION: '2.0.5'
16+
MAESTRO_VERSION: '2.0.6'
1717
RN_SENTRY_POD_NAME: RNSentry
1818
IOS_APP_ARCHIVE_PATH: sentry-react-native-sample.app.zip
1919
ANDROID_APP_ARCHIVE_PATH: sentry-react-native-sample.apk.zip

CHANGELOG.md

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

1111
### Features
1212

13+
- Adds Console logs as Sentry Logs. ([#5261](https://github.com/getsentry/sentry-react-native/pull/5261))
1314
- Adds support for `propagateTraceparent` ([#5277](https://github.com/getsentry/sentry-react-native/pull/5227))
1415

1516
### Fixes
1617

1718
- Fix compatibility with `react-native-legal` ([#5253](https://github.com/getsentry/sentry-react-native/pull/5253))
1819
- The licenses json file is correctly generated and placed into the `res/` folder now
20+
- Handle missing shouldAddToIgnoreList callback in Metro ([#5260](https://github.com/getsentry/sentry-react-native/pull/5260))
21+
- Overrides the default Cocoa SDK behavior that disables Session Replay on iOS 26.0 ([#5268](https://github.com/getsentry/sentry-react-native/pull/5268))
22+
- If you are using Apple's Liquid Glass we recommend that you disable Session Replay on iOS to prevent potential PII leaks (see [sentry-cocoa 8.57.0 release note warning](https://github.com/getsentry/sentry-cocoa/releases/tag/8.57.0))
1923

2024
### Dependencies
2125

22-
- Bump JavaScript SDK from v10.18.0 to v10.19.0 ([#5254](https://github.com/getsentry/sentry-react-native/pull/5254))
23-
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#10190)
24-
- [diff](https://github.com/getsentry/sentry-javascript/compare/10.18.0...10.19.0)
26+
- Bump JavaScript SDK from v10.18.0 to v10.20.0 ([#5254](https://github.com/getsentry/sentry-react-native/pull/5254), [#5272](https://github.com/getsentry/sentry-react-native/pull/5272))
27+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#10200)
28+
- [diff](https://github.com/getsentry/sentry-javascript/compare/10.18.0...10.20.0)
2529
- Bump CLI from v2.56.0 to v2.56.1 ([#5257](https://github.com/getsentry/sentry-react-native/pull/5257))
2630
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2561)
2731
- [diff](https://github.com/getsentry/sentry-cli/compare/2.56.0...2.56.1)
2832
- Bump Bundler Plugins from v4.3.0 to v4.4.0 ([#5256](https://github.com/getsentry/sentry-react-native/pull/5256))
2933
- [changelog](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/main/CHANGELOG.md#440)
3034
- [diff](https://github.com/getsentry/sentry-javascript-bundler-plugins/compare/4.3.0...4.4.0)
35+
- Bump Cocoa SDK from v8.56.2 to v8.57.0 ([#5263](https://github.com/getsentry/sentry-react-native/pull/5263))
36+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8570)
37+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.56.2...8.57.0)
3138

3239
## 7.3.0
3340

dev-packages/e2e-tests/cli.mjs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,6 @@ if (actions.includes('create')) {
103103
env: env,
104104
});
105105

106-
// Only apply the package.json patch for newer RN versions
107-
const versionNumber = parseFloat(RNVersion.replace(/[^\d.]/g, ''));
108-
if (versionNumber >= 0.80) {
109-
execSync(`${patchScriptsDir}/rn.patch.package.json.js --path package.json`, {
110-
stdio: 'inherit',
111-
cwd: appDir,
112-
env: env,
113-
});
114-
} else {
115-
console.log(`Skipping rn.patch.package.json.js for RN ${RNVersion} (< 0.80)`);
116-
}
117-
118106
// Install dependencies
119107
// yalc add doesn't fail if the package is not found - it skips silently.
120108
let yalcAddOutput = execSync(`yalc add @sentry/react-native`, { cwd: appDir, env: env, encoding: 'utf-8' });

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.19.0",
16+
"@sentry/core": "10.20.0",
1717
"@sentry/react-native": "7.3.0",
1818
"@types/node": "^20.9.3",
1919
"@types/react": "^18.2.64",

dev-packages/e2e-tests/patch-scripts/rn.patch.package.json.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

packages/core/RNSentry.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Pod::Spec.new do |s|
4646

4747
s.compiler_flags = other_cflags
4848

49-
s.dependency 'Sentry/HybridSDK', '8.56.2'
49+
s.dependency 'Sentry/HybridSDK', '8.57.0'
5050

5151
if defined? install_modules_dependencies
5252
# Default React Native dependencies for 0.71 and above (new and legacy architecture)

packages/core/RNSentryCocoaTester/RNSentryCocoaTesterTests/RNSentryTests.m

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,4 +736,129 @@ - (void)testIgnoreErrorsRegexAndStringBothWork
736736
XCTAssertNotNil(result3, @"Event with non-matching error should not be dropped");
737737
}
738738

739+
- (void)testCreateOptionsWithDictionaryEnableSessionReplayInUnreliableEnvironmentDefault
740+
{
741+
RNSentry *rnSentry = [[RNSentry alloc] init];
742+
NSError *error = nil;
743+
744+
NSDictionary *_Nonnull mockedReactNativeDictionary = @{
745+
@"dsn" : @"https://[email protected]/123456",
746+
};
747+
SentryOptions *actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary
748+
error:&error];
749+
750+
XCTAssertNotNil(actualOptions, @"Did not create sentry options");
751+
XCTAssertNil(error, @"Should not pass no error");
752+
753+
id experimentalOptions = [actualOptions valueForKey:@"experimental"];
754+
XCTAssertNotNil(experimentalOptions, @"Experimental options should not be nil");
755+
756+
BOOL enableUnhandledCPPExceptions =
757+
[[experimentalOptions valueForKey:@"enableSessionReplayInUnreliableEnvironment"] boolValue];
758+
XCTAssertFalse(enableUnhandledCPPExceptions,
759+
@"enableSessionReplayInUnreliableEnvironment should be disabled");
760+
}
761+
762+
- (void)testCreateOptionsWithDictionaryEnableSessionReplayInUnreliableEnvironmentWithErrorSampleRate
763+
{
764+
RNSentry *rnSentry = [[RNSentry alloc] init];
765+
NSError *error = nil;
766+
767+
NSDictionary *_Nonnull mockedReactNativeDictionary = @{
768+
@"dsn" : @"https://[email protected]/123456",
769+
@"replaysOnErrorSampleRate" : @1.0,
770+
@"replaysSessionSampleRate" : @0
771+
};
772+
SentryOptions *actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary
773+
error:&error];
774+
775+
XCTAssertNotNil(actualOptions, @"Did not create sentry options");
776+
XCTAssertNil(error, @"Should not pass no error");
777+
778+
id experimentalOptions = [actualOptions valueForKey:@"experimental"];
779+
XCTAssertNotNil(experimentalOptions, @"Experimental options should not be nil");
780+
781+
BOOL enableUnhandledCPPExceptions =
782+
[[experimentalOptions valueForKey:@"enableSessionReplayInUnreliableEnvironment"] boolValue];
783+
XCTAssertTrue(enableUnhandledCPPExceptions,
784+
@"enableSessionReplayInUnreliableEnvironment should be enabled");
785+
}
786+
787+
- (void)
788+
testCreateOptionsWithDictionaryEnableSessionReplayInUnreliableEnvironmentWithSessionSampleRate
789+
{
790+
RNSentry *rnSentry = [[RNSentry alloc] init];
791+
NSError *error = nil;
792+
793+
NSDictionary *_Nonnull mockedReactNativeDictionary = @{
794+
@"dsn" : @"https://[email protected]/123456",
795+
@"replaysOnErrorSampleRate" : @0.0,
796+
@"replaysSessionSampleRate" : @0.1
797+
};
798+
SentryOptions *actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary
799+
error:&error];
800+
801+
XCTAssertNotNil(actualOptions, @"Did not create sentry options");
802+
XCTAssertNil(error, @"Should not pass no error");
803+
804+
id experimentalOptions = [actualOptions valueForKey:@"experimental"];
805+
XCTAssertNotNil(experimentalOptions, @"Experimental options should not be nil");
806+
807+
BOOL enableUnhandledCPPExceptions =
808+
[[experimentalOptions valueForKey:@"enableSessionReplayInUnreliableEnvironment"] boolValue];
809+
XCTAssertTrue(enableUnhandledCPPExceptions,
810+
@"enableSessionReplayInUnreliableEnvironment should be enabled");
811+
}
812+
813+
- (void)
814+
testCreateOptionsWithDictionaryEnableSessionReplayInUnreliableEnvironmentWithSessionSampleRates
815+
{
816+
RNSentry *rnSentry = [[RNSentry alloc] init];
817+
NSError *error = nil;
818+
819+
NSDictionary *_Nonnull mockedReactNativeDictionary = @{
820+
@"dsn" : @"https://[email protected]/123456",
821+
@"replaysOnErrorSampleRate" : @1.0,
822+
@"replaysSessionSampleRate" : @0.1
823+
};
824+
SentryOptions *actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary
825+
error:&error];
826+
827+
XCTAssertNotNil(actualOptions, @"Did not create sentry options");
828+
XCTAssertNil(error, @"Should not pass no error");
829+
830+
id experimentalOptions = [actualOptions valueForKey:@"experimental"];
831+
XCTAssertNotNil(experimentalOptions, @"Experimental options should not be nil");
832+
833+
BOOL enableUnhandledCPPExceptions =
834+
[[experimentalOptions valueForKey:@"enableSessionReplayInUnreliableEnvironment"] boolValue];
835+
XCTAssertTrue(enableUnhandledCPPExceptions,
836+
@"enableSessionReplayInUnreliableEnvironment should be enabled");
837+
}
838+
839+
- (void)testCreateOptionsWithDictionaryEnableSessionReplayInUnreliableEnvironmentDisabled
840+
{
841+
RNSentry *rnSentry = [[RNSentry alloc] init];
842+
NSError *error = nil;
843+
844+
NSDictionary *_Nonnull mockedReactNativeDictionary = @{
845+
@"dsn" : @"https://[email protected]/123456",
846+
@"replaysOnErrorSampleRate" : @0,
847+
@"replaysSessionSampleRate" : @0
848+
};
849+
SentryOptions *actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary
850+
error:&error];
851+
852+
XCTAssertNotNil(actualOptions, @"Did not create sentry options");
853+
XCTAssertNil(error, @"Should not pass no error");
854+
855+
id experimentalOptions = [actualOptions valueForKey:@"experimental"];
856+
XCTAssertNotNil(experimentalOptions, @"Experimental options should not be nil");
857+
858+
BOOL enableUnhandledCPPExceptions =
859+
[[experimentalOptions valueForKey:@"enableSessionReplayInUnreliableEnvironment"] boolValue];
860+
XCTAssertFalse(enableUnhandledCPPExceptions,
861+
@"enableSessionReplayInUnreliableEnvironment should be disabled");
862+
}
863+
739864
@end
0 Bytes
Binary file not shown.

packages/core/ios/RNSentry.mm

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ - (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull)
234234
[mutableOptions removeObjectForKey:@"enableTracing"];
235235

236236
#if SENTRY_TARGET_REPLAY_SUPPORTED
237-
[RNSentryReplay updateOptions:mutableOptions];
237+
BOOL isSessionReplayEnabled = [RNSentryReplay updateOptions:mutableOptions];
238+
#else
239+
// Defaulting to false for unsupported targets
240+
BOOL isSessionReplayEnabled = NO;
238241
#endif
239242

240243
SentryOptions *sentryOptions = [SentryOptionsInternal initWithDict:mutableOptions
@@ -315,6 +318,11 @@ - (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull)
315318
sentryOptions:sentryOptions];
316319
}
317320

321+
if (isSessionReplayEnabled) {
322+
[RNSentryExperimentalOptions setEnableSessionReplayInUnreliableEnvironment:YES
323+
sentryOptions:sentryOptions];
324+
}
325+
318326
return sentryOptions;
319327
}
320328

0 commit comments

Comments
 (0)