Skip to content

Commit 23025e4

Browse files
Merge remote-tracking branch 'origin/main' into 5.0.0
2 parents b592ac0 + 4a6983a commit 23025e4

37 files changed

+3195
-3729
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ updates:
55
schedule:
66
interval: weekly
77
open-pull-requests-limit: 2
8+
ignore:
9+
- dependency-name: "@sentry*"
810
- package-ecosystem: gradle
911
directory: "/android"
1012
schedule:

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@807578363a7869ca324a79039e6db9c843e0e100 # pin@v2
42+
uses: github/codeql-action/init@c3b6fce4ee2ca25bc1066aa3bf73962fda0e8898 # pin@v2
4343
with:
4444
languages: ${{ matrix.language }}
4545
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +50,7 @@ jobs:
5050
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5151
# If this step fails, then you should remove it and run the build manually (see below)
5252
- name: Autobuild
53-
uses: github/codeql-action/autobuild@807578363a7869ca324a79039e6db9c843e0e100 # pin@v2
53+
uses: github/codeql-action/autobuild@c3b6fce4ee2ca25bc1066aa3bf73962fda0e8898 # pin@v2
5454

5555
# ℹ️ Command-line programs to run using the OS shell.
5656
# 📚 https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
@@ -61,4 +61,4 @@ jobs:
6161
# make bootstrap
6262
# make release
6363
- name: Perform CodeQL Analysis
64-
uses: github/codeql-action/analyze@807578363a7869ca324a79039e6db9c843e0e100 # pin@v2
64+
uses: github/codeql-action/analyze@c3b6fce4ee2ca25bc1066aa3bf73962fda0e8898 # pin@v2

.github/workflows/e2e.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
platform: ['ios', 'android']
2020
include:
2121
- platform: ios
22-
runtime: '15.2'
23-
device: 'iPhone 12'
22+
runtime: '16.0'
23+
device: 'iPhone 14'
2424
env:
2525
PLATFORM: ${{ matrix.platform }}
2626
RUNTIME: ${{ matrix.runtime }}
@@ -107,15 +107,15 @@ jobs:
107107

108108
# Wait until the Appium server starts.
109109
- name: Check Appium Server
110-
uses: nick-fields/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f # pin@v2
110+
uses: nick-fields/retry@3e91a01664abd3c5cd539100d10d33b9c5b68482 # pin@v2
111111
with:
112112
timeout_seconds: 60
113113
max_attempts: 10
114114
command: curl --output /dev/null --silent --head --fail http://127.0.0.1:4723/sessions
115115

116116
- name: Run tests on Android
117117
if: ${{ matrix.platform == 'android' }}
118-
uses: reactivecircus/android-emulator-runner@d7b53ddc6e44254e1f4cf4a6ad67345837027a66 # pin@v2
118+
uses: reactivecircus/android-emulator-runner@50986b1464923454c95e261820bc626f38490ec0 # pin@v2
119119
with:
120120
api-level: 29
121121
emulator-options: -accel on -no-snapshot -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none -timezone US/Pacific

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,33 @@
1212

1313
- Send react native js engine, turbo module, fabric flags and component stack in Event contexts ([#2552](https://github.com/getsentry/sentry-react-native/pull/2552))
1414

15+
### Features
16+
17+
- Add `maxQueueSize` option ([#2578](https://github.com/getsentry/sentry-react-native/pull/2578))
18+
19+
### Fixes
20+
21+
- Use `Scope` class rather than `Scope` type for top-level functions ([#2627](https://github.com/getsentry/sentry-react-native/pull/2627))
22+
23+
### Dependencies
24+
25+
- Bump JavaScript SDK from v7.16.0 to v7.20.1 ([#2582](https://github.com/getsentry/sentry-react-native/pull/2582), [#2598](https://github.com/getsentry/sentry-react-native/pull/2598), [#2632](https://github.com/getsentry/sentry-react-native/pull/2632), [#2607](https://github.com/getsentry/sentry-react-native/pull/2607))
26+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#7201)
27+
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.16.0...7.20.1)
28+
- Bump Cocoa SDK from v7.29.0 to v7.31.2 ([#2592](https://github.com/getsentry/sentry-react-native/pull/2592), [#2601](https://github.com/getsentry/sentry-react-native/pull/2601), [#2629](https://github.com/getsentry/sentry-react-native/pull/2629))
29+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/master/CHANGELOG.md#7312)
30+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/7.29.0...7.31.2)
31+
- Bump Android SDK from v6.6.0 to v6.8.0 ([#2600](https://github.com/getsentry/sentry-react-native/pull/2600), [#2628](https://github.com/getsentry/sentry-react-native/pull/2628))
32+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#680)
33+
- [diff](https://github.com/getsentry/sentry-java/compare/6.6.0...6.8.0)
34+
35+
## 4.8.0
36+
37+
### Fixes
38+
39+
- Message event can have attached stacktrace ([#2577](https://github.com/getsentry/sentry-react-native/pull/2577))
40+
- Fixed maximum call stack exceeded error resulting from large payloads ([#2579](https://github.com/getsentry/sentry-react-native/pull/2579))
41+
1542
### Dependencies
1643

1744
- Bump CLI from v1.74.4 to v2.7.0 ([#2457](https://github.com/getsentry/sentry-react-native/pull/2457))

CONTRIBUTING.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,85 @@ You can optionally start the Metro bundler if you want to control where it runs:
8383
```sh
8484
yarn start --reset-cache
8585
```
86+
87+
Run the emulators:
88+
89+
```sh
90+
yarn react-native run-ios
91+
yarn react-native run-android
92+
```
93+
94+
## Develop with sentry-cocoa
95+
96+
Here are step on how to test your changes in `sentry-cocoa` with `sentry-react-native`. We assume you have both repositories cloned in siblings folders.
97+
98+
1. Build `sentry-cocoa`.
99+
100+
```sh
101+
cd sentry-cocoa
102+
make init
103+
make build-xcframework
104+
```
105+
106+
2. Link local `sentry-cocoa` build in `sentry-react-native`
107+
108+
```sh
109+
cd sentry-react-native
110+
```
111+
112+
Comment out sentry dependency in `RNSentry.podspec`.
113+
114+
```diff
115+
- s.dependency 'Sentry/HybridSDK', '7.31.0'
116+
+ # s.dependency 'Sentry/HybridSDK', '7.31.0'
117+
```
118+
119+
Add local pods to `sample/ios/Podfile`.
120+
121+
```diff
122+
target 'sample' do
123+
124+
# ... react native config
125+
126+
+ pod 'Sentry/HybridSDK', :path => '../../../sentry-cocoa'
127+
128+
# ... rest of the configuration
129+
130+
end
131+
```
132+
133+
## Develop with sentry-java
134+
135+
Here are step on how to test your changes in `sentry-java` with `sentry-react-native`. We assume that you have `sentry-java` setup, Android SDK installed, correct JAVA version etc.
136+
137+
1. Build and publish `sentry-java` locally.
138+
139+
```sh
140+
cd sentry-java
141+
make dryRelease
142+
ls ~/.m2/repository/io/sentry/sentry-android # check that `sentry-java` was published
143+
```
144+
145+
2. Add local maven to the sample project.
146+
147+
```sh
148+
cd sentry-react-native/sample
149+
```
150+
151+
Add local maven to `sample/android/build.gradle`.
152+
153+
```diff
154+
allprojects {
155+
repositories {
156+
+ mavenLocal()
157+
```
158+
159+
Update `sentry-android` version, to the one locally published, in `android/build.gradle`.
160+
161+
```diff
162+
dependencies {
163+
implementation 'com.facebook.react:react-native:+'
164+
- api 'io.sentry:sentry-android:5.4.0'
165+
+ api 'io.sentry:sentry-android:6.7.7-my-local-version'
166+
}
167+
```

RNSentry.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
1919
s.preserve_paths = '*.js'
2020

2121
s.dependency 'React-Core'
22-
s.dependency 'Sentry', '7.29.0'
22+
s.dependency 'Sentry/HybridSDK', '7.31.2'
2323

2424
s.source_files = 'ios/RNSentry.{h,mm}'
2525
s.public_header_files = 'ios/RNSentry.h'

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ android {
4242

4343
dependencies {
4444
implementation 'com.facebook.react:react-native:+'
45-
api 'io.sentry:sentry-android:6.6.0'
45+
api 'io.sentry:sentry-android:6.8.0'
4646
}

android/src/main/java/io/sentry/react/RNSentryModuleImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ public void initNativeSdk(final ReadableMap rnOptions, Promise promise) {
130130
if (rnOptions.hasKey("sendDefaultPii")) {
131131
options.setSendDefaultPii(rnOptions.getBoolean("sendDefaultPii"));
132132
}
133+
if (rnOptions.hasKey("maxQueueSize")) {
134+
options.setMaxQueueSize(rnOptions.getInt("maxQueueSize"));
135+
}
133136

134137
options.setBeforeSend((event, hint) -> {
135138
// React native internally throws a JavascriptException

ios/RNSentry.mm

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#endif
88

99
#import <Sentry/Sentry.h>
10+
#import <Sentry/PrivateSentrySDKOnly.h>
1011
#import <Sentry/SentryScreenFrames.h>
1112

1213
// Thanks to this guard, we won't import this header when we build for the old architecture.
@@ -30,7 +31,6 @@ + (void)storeEnvelope:(SentryEnvelope *)envelope;
3031

3132
@implementation RNSentry {
3233
bool sentHybridSdkDidBecomeActive;
33-
SentryOptions *sentryOptions;
3434
}
3535

3636
- (dispatch_queue_t)methodQueue
@@ -73,7 +73,7 @@ + (BOOL)requiresMainQueueSetup {
7373
[mutableOptions removeObjectForKey:@"tracesSampleRate"];
7474
[mutableOptions removeObjectForKey:@"tracesSampler"];
7575

76-
sentryOptions = [[SentryOptions alloc] initWithDict:mutableOptions didFailWithError:&error];
76+
SentryOptions *sentryOptions = [[SentryOptions alloc] initWithDict:mutableOptions didFailWithError:&error];
7777
if (error) {
7878
reject(@"SentryReactNative", error.localizedDescription, error);
7979
return;
@@ -108,7 +108,7 @@ + (BOOL)requiresMainQueueSetup {
108108
#endif
109109

110110
// If the app is active/in foreground, and we have not sent the SentryHybridSdkDidBecomeActive notification, send it.
111-
if (appIsActive && !sentHybridSdkDidBecomeActive && (sentryOptions.enableAutoSessionTracking || sentryOptions.enableOutOfMemoryTracking)) {
111+
if (appIsActive && !sentHybridSdkDidBecomeActive && (PrivateSentrySDKOnly.options.enableAutoSessionTracking || PrivateSentrySDKOnly.options.enableOutOfMemoryTracking)) {
112112
[[NSNotificationCenter defaultCenter]
113113
postNotificationName:@"SentryHybridSdkDidBecomeActive"
114114
object:nil];
@@ -155,13 +155,9 @@ - (void)setEventEnvironmentTag:(SentryEvent *)event
155155
RCT_EXPORT_METHOD(fetchNativeSdkInfo:(RCTPromiseResolveBlock)resolve
156156
rejecter:(RCTPromiseRejectBlock)reject)
157157
{
158-
if (sentryOptions == nil) {
159-
return reject(@"SentryReactNative",@"Called fetchNativeSdkInfo without initializing the SDK first.", nil);
160-
}
161-
162158
resolve(@{
163-
@"name": sentryOptions.sdkInfo.name,
164-
@"version": sentryOptions.sdkInfo.version
159+
@"name": PrivateSentrySDKOnly.getSdkName,
160+
@"version": PrivateSentrySDKOnly.getSdkVersionString
165161
});
166162
}
167163

@@ -190,7 +186,7 @@ - (void)setEventEnvironmentTag:(SentryEvent *)event
190186
if (tempContexts != nil) {
191187
[contexts setValue:tempContexts forKey:@"context"];
192188
}
193-
if (sentryOptions != nil && sentryOptions.debug) {
189+
if (PrivateSentrySDKOnly.options.debug) {
194190
NSData *data = [NSJSONSerialization dataWithJSONObject:contexts options:0 error:nil];
195191
NSString *debugContext = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
196192
NSLog(@"Contexts: %@", debugContext);

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,32 +40,32 @@
4040
"react-native": ">=0.70.0"
4141
},
4242
"dependencies": {
43-
"@sentry/browser": "7.16.0",
44-
"@sentry/cli": "2.7.0",
45-
"@sentry/core": "7.16.0",
46-
"@sentry/hub": "7.16.0",
47-
"@sentry/integrations": "7.16.0",
48-
"@sentry/react": "7.16.0",
49-
"@sentry/tracing": "7.16.0",
50-
"@sentry/types": "7.16.0",
51-
"@sentry/utils": "7.16.0"
43+
"@sentry/browser": "7.20.1",
44+
"@sentry/cli": "2.9.0",
45+
"@sentry/core": "7.20.1",
46+
"@sentry/hub": "7.20.1",
47+
"@sentry/integrations": "7.20.1",
48+
"@sentry/react": "7.20.1",
49+
"@sentry/tracing": "7.20.1",
50+
"@sentry/types": "7.20.1",
51+
"@sentry/utils": "7.20.1"
5252
},
5353
"devDependencies": {
54-
"@sentry-internal/eslint-config-sdk": "7.16.0",
55-
"@sentry-internal/eslint-plugin-sdk": "7.16.0",
54+
"@sentry-internal/eslint-config-sdk": "7.20.1",
55+
"@sentry-internal/eslint-plugin-sdk": "7.20.1",
5656
"@sentry/typescript": "^5.20.1",
5757
"@sentry/wizard": "2.2.0",
5858
"@types/jest": "^26.0.15",
59-
"@types/react": "^18",
60-
"@types/react-native": "^0.70.0",
59+
"@types/react": "^18.0.25",
60+
"@types/react-native": "^0.70.6",
6161
"babel-jest": "^26.1.0",
6262
"eslint": "^7.6.0",
6363
"eslint-plugin-react": "^7.20.6",
6464
"eslint-plugin-react-native": "^3.8.1",
6565
"jest": "^24.9.0",
6666
"prettier": "^2.0.5",
67-
"react": "^18",
68-
"react-native": "^0.70.0",
67+
"react": "^18.2.0",
68+
"react-native": "^0.70.5",
6969
"replace-in-file": "^6.0.0",
7070
"rimraf": "^3.0.0",
7171
"ts-jest": "^24.3.0",

0 commit comments

Comments
 (0)