@sentry/react-native 5.4.1 → 5.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.4.2
4
+
5
+ ### Fixes
6
+
7
+ - Fix `event.origin` and `event.environment` on unhandled exception ([#3041](https://github.com/getsentry/sentry-react-native/pull/3041))
8
+ - Don't pass `enableTracing` from RN to `sentry-cocoa` options ([#3042](https://github.com/getsentry/sentry-react-native/pull/3042))
9
+ - Only store envelopes of fatal crashes on iOS ([#3051](https://github.com/getsentry/sentry-react-native/pull/3051))
10
+
11
+ ### Dependencies
12
+
13
+ - Bump JavaScript SDK from v7.50.0 to v7.51.1 ([#3043](https://github.com/getsentry/sentry-react-native/pull/3043), [#3053](https://github.com/getsentry/sentry-react-native/pull/3053))
14
+ - [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7511)
15
+ - [diff](https://github.com/getsentry/sentry-javascript/compare/7.50.0...7.51.1)
16
+
3
17
  ## 5.4.1
4
18
 
5
19
  ### Fixes
@@ -10,7 +10,6 @@ import android.content.res.AssetManager;
10
10
  import android.util.SparseIntArray;
11
11
 
12
12
  import androidx.annotation.Nullable;
13
- import androidx.annotation.NonNull;
14
13
  import androidx.core.app.FrameMetricsAggregator;
15
14
 
16
15
  import com.facebook.react.bridge.Arguments;
@@ -69,6 +68,8 @@ public class RNSentryModuleImpl {
69
68
 
70
69
  public static final String NAME = "RNSentry";
71
70
 
71
+ private static final String NATIVE_SDK_NAME = "sentry.native.android";
72
+ private static final String ANDROID_SDK_NAME = "sentry.java.android.react-native";
72
73
  private static final ILogger logger = new AndroidLogger(NAME);
73
74
  private static final BuildInfoProvider buildInfo = new BuildInfoProvider(logger);
74
75
  private static final String modulesPath = "modules.json";
@@ -104,12 +105,11 @@ public class RNSentryModuleImpl {
104
105
 
105
106
  public void initNativeSdk(final ReadableMap rnOptions, Promise promise) {
106
107
  SentryAndroid.init(this.getReactApplicationContext(), options -> {
107
- @NonNull final String sdkName = "sentry.java.android.react-native";
108
108
  @Nullable SdkVersion sdkVersion = options.getSdkVersion();
109
109
  if (sdkVersion == null) {
110
- sdkVersion = new SdkVersion(sdkName, BuildConfig.VERSION_NAME);
110
+ sdkVersion = new SdkVersion(ANDROID_SDK_NAME, BuildConfig.VERSION_NAME);
111
111
  } else {
112
- sdkVersion.setName(sdkName);
112
+ sdkVersion.setName(ANDROID_SDK_NAME);
113
113
  }
114
114
 
115
115
  options.setSentryClientName(sdkVersion.getName() + "/" + sdkVersion.getVersion());
@@ -621,10 +621,10 @@ public class RNSentryModuleImpl {
621
621
  switch (sdk.getName()) {
622
622
  // If the event is from capacitor js, it gets set there and we do not handle it
623
623
  // here.
624
- case "sentry.native":
624
+ case NATIVE_SDK_NAME:
625
625
  setEventEnvironmentTag(event, "native");
626
626
  break;
627
- case "sentry.java.android":
627
+ case ANDROID_SDK_NAME:
628
628
  setEventEnvironmentTag(event, "java");
629
629
  break;
630
630
  default:
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "5.4.1";
3
+ export declare const SDK_VERSION = "5.4.2";
4
4
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';
2
2
  export const SDK_NAME = 'sentry.javascript.react-native';
3
- export const SDK_VERSION = '5.4.1';
3
+ export const SDK_VERSION = '5.4.2';
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.4.1';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.4.2';\n"]}
package/ios/RNSentry.h CHANGED
@@ -11,4 +11,6 @@
11
11
  - (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull)options
12
12
  error:(NSError *_Nullable*_Nonnull)errorPointer;
13
13
 
14
+ - (void)setEventOriginTag:(SentryEvent *)event;
15
+
14
16
  @end
package/ios/RNSentry.mm CHANGED
@@ -30,6 +30,8 @@
30
30
 
31
31
  static bool didFetchAppStart;
32
32
 
33
+ static NSString* const nativeSdkName = @"sentry.cocoa.react-native";
34
+
33
35
  @implementation RNSentry {
34
36
  bool sentHybridSdkDidBecomeActive;
35
37
  }
@@ -56,9 +58,8 @@ RCT_EXPORT_METHOD(initNativeSdk:(NSDictionary *_Nonnull)options
56
58
  return;
57
59
  }
58
60
 
59
- NSString *sdkName = @"sentry.cocoa.react-native";
60
61
  NSString *sdkVersion = [PrivateSentrySDKOnly getSdkVersionString];
61
- [PrivateSentrySDKOnly setSdkName: sdkName andVersionString: sdkVersion];
62
+ [PrivateSentrySDKOnly setSdkName: nativeSdkName andVersionString: sdkVersion];
62
63
 
63
64
  [SentrySDK startWithOptions:sentryOptions];
64
65
 
@@ -105,6 +106,7 @@ RCT_EXPORT_METHOD(initNativeSdk:(NSDictionary *_Nonnull)options
105
106
  // The user could tho initialize the SDK manually and set themselves.
106
107
  [mutableOptions removeObjectForKey:@"tracesSampleRate"];
107
108
  [mutableOptions removeObjectForKey:@"tracesSampler"];
109
+ [mutableOptions removeObjectForKey:@"enableTracing"];
108
110
 
109
111
  SentryOptions *sentryOptions = [[SentryOptions alloc] initWithDict:mutableOptions didFailWithError:errorPointer];
110
112
  if (*errorPointer != nil) {
@@ -137,9 +139,9 @@ RCT_EXPORT_METHOD(initNativeSdk:(NSDictionary *_Nonnull)options
137
139
  if (event.sdk != nil) {
138
140
  NSString *sdkName = event.sdk[@"name"];
139
141
 
140
- // If the event is from react native, it gets set there and we do not handle
141
- // it here.
142
- if ([sdkName isEqualToString:@"sentry.cocoa"]) {
142
+ // If the event is from react native, it gets set
143
+ // there and we do not handle it here.
144
+ if ([sdkName isEqual:nativeSdkName]) {
143
145
  [self setEventEnvironmentTag:event origin:@"ios" environment:@"native"];
144
146
  }
145
147
  }
@@ -317,7 +319,7 @@ RCT_EXPORT_METHOD(captureEnvelope:(NSArray * _Nonnull)bytes
317
319
  #if DEBUG
318
320
  [PrivateSentrySDKOnly captureEnvelope:envelope];
319
321
  #else
320
- if (options[@"store"]) {
322
+ if ([[options objectForKey:@"store"] boolValue]) {
321
323
  // Storing to disk happens asynchronously with captureEnvelope
322
324
  [PrivateSentrySDKOnly storeEnvelope:envelope];
323
325
  } else {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sentry/react-native",
3
3
  "homepage": "https://github.com/getsentry/sentry-react-native",
4
4
  "repository": "https://github.com/getsentry/sentry-react-native",
5
- "version": "5.4.1",
5
+ "version": "5.4.2",
6
6
  "description": "Official Sentry SDK for react-native",
7
7
  "typings": "dist/js/index.d.ts",
8
8
  "types": "dist/js/index.d.ts",
@@ -55,18 +55,18 @@
55
55
  "react-native": ">=0.65.0"
56
56
  },
57
57
  "dependencies": {
58
- "@sentry/browser": "7.50.0",
58
+ "@sentry/browser": "7.51.1",
59
59
  "@sentry/cli": "2.17.5",
60
- "@sentry/core": "7.50.0",
61
- "@sentry/hub": "7.50.0",
62
- "@sentry/integrations": "7.50.0",
63
- "@sentry/react": "7.50.0",
64
- "@sentry/types": "7.50.0",
65
- "@sentry/utils": "7.50.0"
60
+ "@sentry/core": "7.51.1",
61
+ "@sentry/hub": "7.51.1",
62
+ "@sentry/integrations": "7.51.1",
63
+ "@sentry/react": "7.51.1",
64
+ "@sentry/types": "7.51.1",
65
+ "@sentry/utils": "7.51.1"
66
66
  },
67
67
  "devDependencies": {
68
- "@sentry-internal/eslint-config-sdk": "7.50.0",
69
- "@sentry-internal/eslint-plugin-sdk": "7.50.0",
68
+ "@sentry-internal/eslint-config-sdk": "7.51.1",
69
+ "@sentry-internal/eslint-plugin-sdk": "7.51.1",
70
70
  "@sentry/typescript": "^5.20.1",
71
71
  "@sentry/wizard": "3.0.0",
72
72
  "@types/jest": "^29.2.5",
@@ -80,7 +80,7 @@
80
80
  "jest-environment-jsdom": "^29.4.1",
81
81
  "prettier": "^2.0.5",
82
82
  "react": "18.2.0",
83
- "react-native": "0.71.0",
83
+ "react-native": "0.71.7",
84
84
  "replace-in-file": "^6.0.0",
85
85
  "rimraf": "^4.1.1",
86
86
  "ts-jest": "^29.0.5",
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "5.4.1";
3
+ export declare const SDK_VERSION = "5.4.2";
4
4
  //# sourceMappingURL=version.d.ts.map