Skip to content

Commit daa76e2

Browse files
Merge branch 'kw-fix-local-synthetic-symbolication' into kw-fix-onunhandled-synthetic-stack
2 parents b090287 + 7ba69b6 commit daa76e2

File tree

119 files changed

+327
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+327
-197
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
dist
33

44
# Ignore standalone apps
5-
sample-new-architecture
5+
samples/react-native
66
test/perf/TestApp*
77

88
# Ignore dangerfile

.github/workflows/buildandtest.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ jobs:
5151
- uses: actions/cache@v3
5252
id: cache
5353
with:
54-
path: sample-new-architecture/node_modules
54+
path: samples/react-native/node_modules
5555
key: ${{ runner.os }}-${{ github.sha }}
5656
- name: Install Dependencies
5757
if: steps.cache.outputs['cache-hit'] != 'true'
5858
run: yarn install
59-
working-directory: sample-new-architecture
59+
working-directory: samples/react-native
6060
- name: Lint Sample
6161
run: yarn lint
62-
working-directory: sample-new-architecture
62+
working-directory: samples/react-native
6363

6464
job_check_integrity:
6565
name: Check package integrity
@@ -180,20 +180,20 @@ jobs:
180180
uses: actions/cache@v3
181181
id: cache-sample
182182
with:
183-
path: sample-new-architecture/node_modules
184-
key: ${{ runner.os }}-${{ hashFiles('sample-new-architecture/yarn.lock') }}
183+
path: samples/react-native/node_modules
184+
key: ${{ runner.os }}-${{ hashFiles('samples/react-native/yarn.lock') }}
185185
- name: Install Dependencies
186186
if: ${{ steps.cache.outputs['cache-hit'] != 'true' }}
187187
run: yarn install
188188
- name: Install Sample Dependencies
189189
if: ${{ steps.cache-sample.outputs['cache-hit'] != 'true' }}
190190
run: yarn install
191-
working-directory: sample-new-architecture
191+
working-directory: samples/react-native
192192
- name: Build
193193
run: yarn build
194194
- name: Make Sample Build Directory
195195
run: mkdir build
196-
working-directory: sample-new-architecture
196+
working-directory: samples/react-native
197197
- name: Bundle
198198
run: |
199199
yarn run react-native bundle \
@@ -203,4 +203,4 @@ jobs:
203203
--reset-cache \
204204
--bundle-output build/bundle.${{ matrix.platform }}.js \
205205
--sourcemap-output build/bundle.${{ matrix.platform }}.map
206-
working-directory: sample-new-architecture
206+
working-directory: samples/react-native

.github/workflows/codegen.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
include:
1717
- platform: android
1818
command: |
19-
cd sample-new-architecture/android
19+
cd samples/react-native/android
2020
./gradlew generateCodegenArtifactsFromSchema
2121
- platform: ios
2222
command: |
23-
cd sample-new-architecture/ios
23+
cd samples/react-native/ios
2424
node ../node_modules/react-native/scripts/generate-codegen-artifacts.js \
2525
--path .. \
2626
--outputPath codegen
@@ -32,12 +32,12 @@ jobs:
3232
- uses: actions/cache@v3
3333
id: cache
3434
with:
35-
path: sample-new-architecture/node_modules
35+
path: samples/react-native/node_modules
3636
key: ${{ runner.os }}-${{ github.sha }}
3737
- name: Install Dependencies
3838
if: steps.cache.outputs['cache-hit'] != 'true'
3939
run: |
40-
cd sample-new-architecture
40+
cd samples/react-native
4141
yarn install
4242
- name: Codegen
4343
run: ${{ matrix.command }}

.github/workflows/sample-application.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- uses: ruby/setup-ruby@v1
4444
if: ${{ matrix.platform == 'ios' }}
4545
with:
46-
working-directory: sample-new-architecture
46+
working-directory: samples/react-native
4747
ruby-version: '3.2.2' # based on what is used in the sample
4848
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
4949

@@ -61,8 +61,8 @@ jobs:
6161
with:
6262
path: |
6363
node_modules
64-
sample-new-architecture/node_modules
65-
key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('yarn.lock', 'sample-new-architecture/yarn.lock') }}
64+
samples/react-native/node_modules
65+
key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('yarn.lock', 'samples/react-native/yarn.lock') }}
6666

6767
- name: Install SDK Dependencies
6868
if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}
@@ -73,12 +73,12 @@ jobs:
7373

7474
- name: Install Sample Dependencies
7575
if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}
76-
working-directory: sample-new-architecture
76+
working-directory: samples/react-native
7777
run: yarn install
7878

7979
- name: Install App Pods
8080
if: ${{ matrix.platform == 'ios' }}
81-
working-directory: sample-new-architecture/ios
81+
working-directory: samples/react-native/ios
8282
run: |
8383
[[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
8484
[[ "${{ matrix.rn-architecture }}" == "new" ]] && ENABLE_NEW_ARCH=1 || ENABLE_NEW_ARCH=0
@@ -89,7 +89,7 @@ jobs:
8989
9090
- name: Build Android App
9191
if: ${{ matrix.platform == 'android' }}
92-
working-directory: sample-new-architecture/android
92+
working-directory: samples/react-native/android
9393
run: |
9494
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
9595
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
@@ -101,7 +101,7 @@ jobs:
101101
102102
- name: Build iOS App
103103
if: ${{ matrix.platform == 'ios' }}
104-
working-directory: sample-new-architecture/ios
104+
working-directory: samples/react-native/ios
105105
run: |
106106
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
107107
echo "Building $CONFIG"
@@ -123,4 +123,4 @@ jobs:
123123
uses: actions/upload-artifact@v3
124124
with:
125125
name: build-sample-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}-logs
126-
path: sample-new-architecture/ios/*.log
126+
path: samples/react-native/ios/*.log

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
"editor.formatOnPaste": false,
2424
"editor.formatOnSave": false
2525
},
26-
"react-native-tools.projectRoot": "./sample-new-architecture",
26+
"react-native-tools.projectRoot": "./samples/sample-new-architecture",
2727
"dart.flutterAdbConnectOnChromeOs": false
2828
}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
import io.sentry.protocol.User;
7272
import io.sentry.protocol.ViewHierarchy;
7373
import io.sentry.util.JsonSerializationUtils;
74+
import io.sentry.vendor.Base64;
7475

7576
public class RNSentryModuleImpl {
7677

@@ -339,11 +340,8 @@ public void fetchNativeFrames(Promise promise) {
339340
}
340341
}
341342

342-
public void captureEnvelope(ReadableArray rawBytes, ReadableMap options, Promise promise) {
343-
byte[] bytes = new byte[rawBytes.size()];
344-
for (int i = 0; i < rawBytes.size(); i++) {
345-
bytes[i] = (byte) rawBytes.getInt(i);
346-
}
343+
public void captureEnvelope(String rawBytes, ReadableMap options, Promise promise) {
344+
byte[] bytes = Base64.decode(rawBytes, Base64.DEFAULT);
347345

348346
try {
349347
InternalSentrySdk.captureEnvelope(bytes);

android/src/newarch/java/io/sentry/react/RNSentryModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void fetchNativeFrames(Promise promise) {
5555
}
5656

5757
@Override
58-
public void captureEnvelope(ReadableArray rawBytes, ReadableMap options, Promise promise) {
58+
public void captureEnvelope(String rawBytes, ReadableMap options, Promise promise) {
5959
this.impl.captureEnvelope(rawBytes, options, promise);
6060
}
6161

android/src/oldarch/java/io/sentry/react/RNSentryModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void fetchNativeFrames(Promise promise) {
5454
}
5555

5656
@ReactMethod
57-
public void captureEnvelope(ReadableArray rawBytes, ReadableMap options, Promise promise) {
57+
public void captureEnvelope(String rawBytes, ReadableMap options, Promise promise) {
5858
this.impl.captureEnvelope(rawBytes, options, promise);
5959
}
6060

ios/RNSentry.mm

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -396,16 +396,12 @@ - (NSDictionary*) fetchNativeStackFramesBy: (NSArray<NSNumber*>*)instructionsAdd
396396
});
397397
}
398398

399-
RCT_EXPORT_METHOD(captureEnvelope:(NSArray * _Nonnull)bytes
399+
RCT_EXPORT_METHOD(captureEnvelope:(NSString * _Nonnull)rawBytes
400400
options: (NSDictionary * _Nonnull)options
401401
resolve:(RCTPromiseResolveBlock)resolve
402402
rejecter:(RCTPromiseRejectBlock)reject)
403403
{
404-
NSMutableData *data = [[NSMutableData alloc] initWithCapacity: [bytes count]];
405-
for(NSNumber *number in bytes) {
406-
char byte = [number charValue];
407-
[data appendBytes: &byte length: 1];
408-
}
404+
NSData *data = [[NSData alloc] initWithBase64EncodedString:rawBytes options:0];
409405

410406
SentryEnvelope *envelope = [PrivateSentrySDKOnly envelopeWithData:data];
411407
if (envelope == nil) {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"lint:eslint": "eslint --config .eslintrc.js .",
3535
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
3636
"test:watch": "jest --watch",
37-
"run-ios": "cd sample-new-architecture && yarn react-native run-ios",
38-
"run-android": "cd sample-new-architecture && yarn react-native run-android",
37+
"run-ios": "cd samples/react-native && yarn react-native run-ios",
38+
"run-android": "cd samples/react-native && yarn react-native run-android",
3939
"yalc:add:sentry-javascript": "yalc add @sentry/browser @sentry/core @sentry/hub @sentry/integrations @sentry/react @sentry/types @sentry/utils"
4040
},
4141
"keywords": [
@@ -70,7 +70,7 @@
7070
"devDependencies": {
7171
"@sentry-internal/eslint-config-sdk": "7.81.1",
7272
"@sentry-internal/eslint-plugin-sdk": "7.81.1",
73-
"@sentry/typescript": "^5.20.1",
73+
"@sentry-internal/typescript": "7.80.0",
7474
"@sentry/wizard": "3.16.3",
7575
"@types/jest": "^29.5.3",
7676
"@types/node": "^20.9.3",
File renamed without changes.
File renamed without changes.

sample-new-architecture/android/app/build.gradle renamed to samples/react-native/android/app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ apply plugin: "com.facebook.react"
33
apply plugin: "io.sentry.android.gradle"
44

55
project.ext.sentryCli = [
6-
collectModulesScript: "../../../dist/js/tools/collectModules.js",
6+
collectModulesScript: "../../../../dist/js/tools/collectModules.js",
77
modulesPaths: [
88
"node_modules",
9-
"../..",
9+
"../../..",
1010
],
1111
skipCollectModules: false,
12-
copyDebugIdScript: "../../../scripts/copy-debugid.js",
13-
hasSourceMapDebugIdScript: "../../../scripts/has-sourcemap-debugid.js",
12+
copyDebugIdScript: "../../../../scripts/copy-debugid.js",
13+
hasSourceMapDebugIdScript: "../../../../scripts/has-sourcemap-debugid.js",
1414
]
1515

16-
apply from: "../../../sentry.gradle"
16+
apply from: "../../../../sentry.gradle"
1717

1818
sentry {
1919
// Whether the plugin should attempt to auto-upload the mapping file to Sentry or not.
File renamed without changes.

sample-new-architecture/babel.config.js renamed to samples/react-native/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
'module-resolver',
66
{
77
alias: {
8-
'@sentry/react-native': '../dist/js',
8+
'@sentry/react-native': '../../dist/js',
99
},
1010
},
1111
],
File renamed without changes.

sample-new-architecture/ios/.xcode.env renamed to samples/react-native/ios/.xcode.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export NODE_BINARY=$(command -v node)
1212

1313
export EXTRA_COMPILER_ARGS="-w"
1414

15-
export SENTRY_CLI_EXECUTABLE="../../node_modules/@sentry/cli/bin/sentry-cli"
15+
export SENTRY_CLI_EXECUTABLE="../../../node_modules/@sentry/cli/bin/sentry-cli"
1616
export SENTRY_CLI_EXTRA_ARGS="--force-foreground"
1717
export SENTRY_CLI_DEBUG_FILES_UPLOAD_EXTRA_ARGS=""
1818
export SENTRY_CLI_RN_XCODE_EXTRA_ARGS=""

sample-new-architecture/ios/Podfile renamed to samples/react-native/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ target 'sampleNewArchitecture' do
5050
end
5151

5252
if !ENV['TEST']
53-
pod 'RNSentry', :path => '../..'
53+
pod 'RNSentry', :path => '../../..'
5454
end
5555

5656
target 'sampleNewArchitectureTests' do

sample-new-architecture/ios/sampleNewArchitecture.xcodeproj/project.pbxproj renamed to samples/react-native/ios/sampleNewArchitecture.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@
271271
);
272272
runOnlyForDeploymentPostprocessing = 0;
273273
shellPath = /bin/sh;
274-
shellScript = "set -e\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\nBUNDLE_REACT_NATIVE=\"/bin/sh ../../scripts/sentry-xcode.sh $REACT_NATIVE_XCODE\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT \\\"$BUNDLE_REACT_NATIVE\\\"\"\n";
274+
shellScript = "set -e\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\nBUNDLE_REACT_NATIVE=\"/bin/sh ../../../scripts/sentry-xcode.sh $REACT_NATIVE_XCODE\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT \\\"$BUNDLE_REACT_NATIVE\\\"\"\n";
275275
};
276276
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
277277
isa = PBXShellScriptBuildPhase;
@@ -303,7 +303,7 @@
303303
);
304304
runOnlyForDeploymentPostprocessing = 0;
305305
shellPath = /bin/sh;
306-
shellScript = "/bin/sh ../../scripts/sentry-xcode-debug-files.sh\n";
306+
shellScript = "/bin/sh ../../../scripts/sentry-xcode-debug-files.sh\n";
307307
};
308308
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = {
309309
isa = PBXShellScriptBuildPhase;

sample-new-architecture/metro.config.js renamed to samples/react-native/metro.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const blacklist = require('metro-config/src/defaults/exclusionList');
44

55
const {
66
createSentryMetroSerializer,
7-
} = require('../dist/js/tools/sentryMetroSerializer');
8-
const parentDir = path.resolve(__dirname, '..');
7+
} = require('../../dist/js/tools/sentryMetroSerializer');
8+
const parentDir = path.resolve(__dirname, '../..');
99

1010
/**
1111
* Metro configuration

sample-new-architecture/package.json renamed to samples/react-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "sample-new-architecture",
2+
"name": "sentry-react-native-bare-sample",
33
"version": "0.0.1",
44
"private": true,
55
"scripts": {

sample-new-architecture/react-native.config.js renamed to samples/react-native/react-native.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const path = require('path');
66
module.exports = {
77
dependencies: {
88
RNSentry: {
9-
root: path.resolve(__dirname, '..'),
9+
root: path.resolve(__dirname, '../../'),
1010
},
1111
},
1212
};
File renamed without changes.

sample-new-architecture/tsconfig.json renamed to samples/react-native/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
99
"baseUrl": ".",
1010
"paths": {
11-
"@sentry/react-native": ["../"]
11+
"@sentry/react-native": ["../../"]
1212
},
1313
},
1414
}
File renamed without changes.

scripts/collect-modules.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if [[ -n "$NODE_BINARY" ]]; then
2929
fi
3030

3131
thisFilePath=$(dirname $0)
32-
collectModulesScript="$thisFilePath/../dist/js/tools/collectModules.js"
32+
collectModulesScript="$thisFilePath/../../dist/js/tools/collectModules.js"
3333

3434
destination="$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH"
3535
modulesOutput="$destination/modules.json"

scripts/update-javascript.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -euo pipefail
33

44
tagPrefix=''
55
repo="https://github.com/getsentry/sentry-javascript.git"
6-
packages=('@sentry/browser' '@sentry/core' '@sentry/hub' '@sentry/integrations' '@sentry/react' '@sentry/types' '@sentry/utils')
6+
packages=('@sentry/browser' '@sentry/core' '@sentry/hub' '@sentry/integrations' '@sentry/react' '@sentry/types' '@sentry/utils' '@sentry-internal/typescript')
77
packages+=('@sentry-internal/eslint-config-sdk' '@sentry-internal/eslint-plugin-sdk')
88

99
. $(dirname "$0")/update-package-json.sh

src/js/NativeRNSentry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
88
export interface Spec extends TurboModule {
99
addBreadcrumb(breadcrumb: UnsafeObject): void;
1010
captureEnvelope(
11-
bytes: number[],
11+
bytes: string,
1212
options: {
1313
store: boolean;
1414
},

0 commit comments

Comments
 (0)