@sentry/react-native 5.17.0 → 5.19.0

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.
Files changed (111) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +1 -1
  3. package/RNSentry.podspec +1 -1
  4. package/android/build.gradle +1 -1
  5. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +117 -26
  6. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +4 -3
  7. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +6 -5
  8. package/dist/js/NativeRNSentry.d.ts +3 -2
  9. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  10. package/dist/js/NativeRNSentry.js.map +1 -1
  11. package/dist/js/client.d.ts.map +1 -1
  12. package/dist/js/client.js +14 -19
  13. package/dist/js/client.js.map +1 -1
  14. package/dist/js/index.d.ts +1 -1
  15. package/dist/js/index.d.ts.map +1 -1
  16. package/dist/js/index.js +5 -1
  17. package/dist/js/index.js.map +1 -1
  18. package/dist/js/integrations/debugsymbolicator.d.ts.map +1 -1
  19. package/dist/js/integrations/debugsymbolicator.js +22 -6
  20. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  21. package/dist/js/integrations/default.d.ts.map +1 -1
  22. package/dist/js/integrations/default.js +6 -0
  23. package/dist/js/integrations/default.js.map +1 -1
  24. package/dist/js/integrations/index.d.ts +1 -0
  25. package/dist/js/integrations/index.d.ts.map +1 -1
  26. package/dist/js/integrations/index.js +1 -0
  27. package/dist/js/integrations/index.js.map +1 -1
  28. package/dist/js/integrations/nativelinkederrors.d.ts +6 -2
  29. package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
  30. package/dist/js/integrations/nativelinkederrors.js +63 -72
  31. package/dist/js/integrations/nativelinkederrors.js.map +1 -1
  32. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  33. package/dist/js/integrations/reactnativeerrorhandlers.js +2 -0
  34. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  35. package/dist/js/integrations/rewriteframes.d.ts +2 -2
  36. package/dist/js/integrations/rewriteframes.d.ts.map +1 -1
  37. package/dist/js/integrations/rewriteframes.js.map +1 -1
  38. package/dist/js/integrations/spotlight.d.ts +18 -0
  39. package/dist/js/integrations/spotlight.d.ts.map +1 -0
  40. package/dist/js/integrations/spotlight.js +84 -0
  41. package/dist/js/integrations/spotlight.js.map +1 -0
  42. package/dist/js/options.d.ts +19 -0
  43. package/dist/js/options.d.ts.map +1 -1
  44. package/dist/js/options.js.map +1 -1
  45. package/dist/js/profiling/cache.d.ts +3 -3
  46. package/dist/js/profiling/cache.d.ts.map +1 -1
  47. package/dist/js/profiling/cache.js.map +1 -1
  48. package/dist/js/profiling/integration.d.ts +7 -3
  49. package/dist/js/profiling/integration.d.ts.map +1 -1
  50. package/dist/js/profiling/integration.js +16 -5
  51. package/dist/js/profiling/integration.js.map +1 -1
  52. package/dist/js/profiling/nativeTypes.d.ts +8 -0
  53. package/dist/js/profiling/nativeTypes.d.ts.map +1 -1
  54. package/dist/js/profiling/nativeTypes.js.map +1 -1
  55. package/dist/js/profiling/types.d.ts +59 -2
  56. package/dist/js/profiling/types.d.ts.map +1 -1
  57. package/dist/js/profiling/types.js.map +1 -1
  58. package/dist/js/profiling/utils.d.ts +9 -5
  59. package/dist/js/profiling/utils.d.ts.map +1 -1
  60. package/dist/js/profiling/utils.js +16 -1
  61. package/dist/js/profiling/utils.js.map +1 -1
  62. package/dist/js/sdk.d.ts +1 -1
  63. package/dist/js/sdk.d.ts.map +1 -1
  64. package/dist/js/sdk.js +3 -2
  65. package/dist/js/sdk.js.map +1 -1
  66. package/dist/js/tools/sentryMetroSerializer.js +1 -0
  67. package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
  68. package/dist/js/tracing/addTracingExtensions.d.ts.map +1 -1
  69. package/dist/js/tracing/addTracingExtensions.js.map +1 -1
  70. package/dist/js/tracing/nativeframes.d.ts.map +1 -1
  71. package/dist/js/tracing/nativeframes.js +3 -1
  72. package/dist/js/tracing/nativeframes.js.map +1 -1
  73. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  74. package/dist/js/tracing/reactnativetracing.js +3 -1
  75. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  76. package/dist/js/utils/worldwide.d.ts +2 -0
  77. package/dist/js/utils/worldwide.d.ts.map +1 -1
  78. package/dist/js/utils/worldwide.js.map +1 -1
  79. package/dist/js/utils/xhr.d.ts +20 -0
  80. package/dist/js/utils/xhr.d.ts.map +1 -0
  81. package/dist/js/utils/xhr.js +31 -0
  82. package/dist/js/utils/xhr.js.map +1 -0
  83. package/dist/js/version.d.ts +1 -1
  84. package/dist/js/version.js +1 -1
  85. package/dist/js/version.js.map +1 -1
  86. package/dist/js/wrapper.d.ts +4 -3
  87. package/dist/js/wrapper.d.ts.map +1 -1
  88. package/dist/js/wrapper.js +19 -19
  89. package/dist/js/wrapper.js.map +1 -1
  90. package/ios/RNSentry.mm +5 -8
  91. package/package.json +16 -12
  92. package/scripts/expo-upload-sourcemaps.js +54 -12
  93. package/scripts/sentry-xcode-debug-files.sh +5 -2
  94. package/src/js/NativeRNSentry.ts +8 -3
  95. package/ts3.8/dist/js/NativeRNSentry.d.ts +3 -2
  96. package/ts3.8/dist/js/index.d.ts +1 -1
  97. package/ts3.8/dist/js/integrations/index.d.ts +1 -0
  98. package/ts3.8/dist/js/integrations/nativelinkederrors.d.ts +6 -2
  99. package/ts3.8/dist/js/integrations/rewriteframes.d.ts +2 -2
  100. package/ts3.8/dist/js/integrations/spotlight.d.ts +18 -0
  101. package/ts3.8/dist/js/options.d.ts +19 -0
  102. package/ts3.8/dist/js/profiling/cache.d.ts +3 -3
  103. package/ts3.8/dist/js/profiling/integration.d.ts +7 -3
  104. package/ts3.8/dist/js/profiling/nativeTypes.d.ts +8 -0
  105. package/ts3.8/dist/js/profiling/types.d.ts +59 -2
  106. package/ts3.8/dist/js/profiling/utils.d.ts +9 -5
  107. package/ts3.8/dist/js/sdk.d.ts +1 -1
  108. package/ts3.8/dist/js/utils/worldwide.d.ts +2 -0
  109. package/ts3.8/dist/js/utils/xhr.d.ts +20 -0
  110. package/ts3.8/dist/js/version.d.ts +1 -1
  111. package/ts3.8/dist/js/wrapper.d.ts +4 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,72 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.19.0
4
+
5
+ This release contains upgrade of `sentry-android` dependency to major version 7. There are no breaking changes in the JS API. If you are using the Android API please check [the migration guide](https://docs.sentry.io/platforms/android/migration/#migrating-from-iosentrysentry-android-6x-to-iosentrysentry-android-700).
6
+
7
+ ### Features
8
+
9
+ - Add Android profiles to React Native Profiling ([#3397](https://github.com/getsentry/sentry-react-native/pull/3397))
10
+ - Add `Sentry.metrics` ([#3590](https://github.com/getsentry/sentry-react-native/pull/3590))
11
+
12
+ To learn more, see the [Set Up Metrics](https://docs.sentry.io/platforms/react-native/metrics/) guide.
13
+
14
+ ```javascript
15
+ import * as Sentry from '@sentry/react-native';
16
+
17
+ Sentry.init({
18
+ dsn: '___DSN___',
19
+ integrations: [
20
+ Sentry.metrics.metricsAggregatorIntegration(),
21
+ ],
22
+ });
23
+
24
+ Sentry.metrics.increment("button_click", 1, {
25
+ tags: { system: "iOS", app_version: "1.0.0" },
26
+ });
27
+ ```
28
+
29
+ ### Fixes
30
+
31
+ - Upload Debug Symbols Build Phase continues when `node` not found in `WITH_ENVIRONMENT` ([#3573](https://github.com/getsentry/sentry-react-native/pull/3573))
32
+ - Fix `proguardUuid` loading on Android ([#3591](https://github.com/getsentry/sentry-react-native/pull/3591))
33
+
34
+ ### Dependencies
35
+
36
+ - Bump Android SDK from v6.34.0 to v7.3.0 ([#3434](https://github.com/getsentry/sentry-react-native/pull/3434))
37
+ - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#730)
38
+ - [diff](https://github.com/getsentry/sentry-java/compare/6.34.0...7.3.0)
39
+ - Bump JavaScript SDK from v7.81.1 to v7.100.1 ([#3426](https://github.com/getsentry/sentry-react-native/pull/3426), [#3589](https://github.com/getsentry/sentry-react-native/pull/3589))
40
+ - [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7990)
41
+ - [diff](https://github.com/getsentry/sentry-javascript/compare/7.81.1...7.100.1)
42
+
43
+ ## 5.18.0
44
+
45
+ ### Features
46
+
47
+ - Add [`@spotlightjs/spotlight`](https://spotlightjs.com/) support ([#3550](https://github.com/getsentry/sentry-react-native/pull/3550))
48
+
49
+ Download the `Spotlight` desktop application and add the integration to your `Sentry.init`.
50
+
51
+ ```javascript
52
+ import * as Sentry from '@sentry/react-native';
53
+
54
+ Sentry.init({
55
+ dsn: '___DSN___',
56
+ enableSpotlight: __DEV__,
57
+ });
58
+ ```
59
+
60
+ - Only upload Expo artifact if source map exists ([#3568](https://github.com/getsentry/sentry-react-native/pull/3568))
61
+ - Read `.env` file in `sentry-expo-upload-sourcemaps` ([#3571](https://github.com/getsentry/sentry-react-native/pull/3571))
62
+
63
+ ### Fixes
64
+
65
+ - Prevent pod install crash when visionos is not present ([#3548](https://github.com/getsentry/sentry-react-native/pull/3548))
66
+ - Fetch Organization slug from `@sentry/react-native/expo` config when uploading artifacts ([#3557](https://github.com/getsentry/sentry-react-native/pull/3557))
67
+ - Remove 404 Http Client Errors reports for Metro Dev Server Requests ([#3553](https://github.com/getsentry/sentry-react-native/pull/3553))
68
+ - Stop tracing Spotlight Sidecar network request in JS ([#3559](https://github.com/getsentry/sentry-react-native/pull/3559))
69
+
3
70
  ## 5.17.0
4
71
 
5
72
  ### Features
@@ -28,6 +95,8 @@
28
95
  - Performance Tracing should be disabled by default ([#3533](https://github.com/getsentry/sentry-react-native/pull/3533))
29
96
  - Use `$NODE_BINARY` to execute Sentry CLI in Xcode scripts ([#3493](https://github.com/getsentry/sentry-react-native/pull/3493))
30
97
  - Return auto Release and Dist to source maps auto upload ([#3540](https://github.com/getsentry/sentry-react-native/pull/3540))
98
+ - Linked errors processed before other integrations ([#3535](https://github.com/getsentry/sentry-react-native/pull/3535))
99
+ - This ensure their frames are correctly symbolicated
31
100
 
32
101
  ### Dependencies
33
102
 
package/README.md CHANGED
@@ -13,11 +13,11 @@ _Bad software is everywhere, and we're tired of it. Sentry is on a mission to he
13
13
  # Sentry SDK for React Native
14
14
 
15
15
  [![Build & Test](https://github.com/getsentry/sentry-react-native/actions/workflows/buildandtest.yml/badge.svg)](https://github.com/getsentry/sentry-react-native/actions/workflows/buildandtest.yml)
16
- [![E2E Tests](https://img.shields.io/github/actions/workflow/status/getsentry/sentry-react-native/.github/workflows/e2e.yml?branch=main)](https://github.com/getsentry/sentry-react-native/actions?query=workflow%3A"End-to-End%20Tests")
17
16
  [![npm version](https://img.shields.io/npm/v/@sentry/react-native.svg)](https://www.npmjs.com/package/@sentry/react-native)
18
17
  [![npm dm](https://img.shields.io/npm/dm/@sentry/react-native.svg)](https://www.npmjs.com/package/@sentry/react-native)
19
18
  [![npm dt](https://img.shields.io/npm/dt/@sentry/react-native.svg)](https://www.npmjs.com/package/@sentry/react-native)
20
19
  [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/PXa5Apfe7K)
20
+ [![Runs with Expo](https://img.shields.io/badge/Runs%20with%20Expo-4630EB.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.dev/)
21
21
 
22
22
  ## Requirements
23
23
 
package/RNSentry.podspec CHANGED
@@ -28,7 +28,7 @@ Pod::Spec.new do |s|
28
28
  s.ios.deployment_target = "11.0"
29
29
  s.osx.deployment_target = "10.13"
30
30
  s.tvos.deployment_target = "11.0"
31
- s.visionos.deployment_target = "1.0"
31
+ s.visionos.deployment_target = "1.0" if s.respond_to?(:visionos)
32
32
 
33
33
  s.preserve_paths = '*.js'
34
34
 
@@ -54,5 +54,5 @@ android {
54
54
 
55
55
  dependencies {
56
56
  implementation 'com.facebook.react:react-native:+'
57
- api 'io.sentry:sentry-android:6.34.0'
57
+ api 'io.sentry:sentry-android:7.3.0'
58
58
  }
@@ -1,6 +1,9 @@
1
1
  package io.sentry.react;
2
2
 
3
+ import static java.util.concurrent.TimeUnit.SECONDS;
3
4
  import static io.sentry.android.core.internal.util.ScreenshotUtils.takeScreenshot;
5
+ import static io.sentry.vendor.Base64.NO_PADDING;
6
+ import static io.sentry.vendor.Base64.NO_WRAP;
4
7
 
5
8
  import android.app.Activity;
6
9
  import android.content.Context;
@@ -15,7 +18,6 @@ import com.facebook.hermes.instrumentation.HermesSamplingProfiler;
15
18
  import com.facebook.react.bridge.Arguments;
16
19
  import com.facebook.react.bridge.Promise;
17
20
  import com.facebook.react.bridge.ReactApplicationContext;
18
- import com.facebook.react.bridge.ReadableArray;
19
21
  import com.facebook.react.bridge.ReadableMap;
20
22
  import com.facebook.react.bridge.ReadableMapKeySetIterator;
21
23
  import com.facebook.react.bridge.UiThreadUtil;
@@ -29,34 +31,38 @@ import org.jetbrains.annotations.Nullable;
29
31
 
30
32
  import java.io.BufferedInputStream;
31
33
  import java.io.BufferedReader;
34
+ import java.io.ByteArrayOutputStream;
32
35
  import java.io.File;
36
+ import java.io.FileInputStream;
33
37
  import java.io.FileNotFoundException;
34
- import java.io.FileOutputStream;
35
38
  import java.io.FileReader;
39
+ import java.io.IOException;
36
40
  import java.io.InputStream;
37
41
  import java.nio.charset.Charset;
38
42
  import java.util.HashMap;
39
43
  import java.util.List;
40
44
  import java.util.Map;
45
+ import java.util.Properties;
41
46
  import java.util.concurrent.CountDownLatch;
42
- import java.util.concurrent.TimeUnit;
43
47
 
44
48
  import io.sentry.Breadcrumb;
45
49
  import io.sentry.DateUtils;
46
50
  import io.sentry.HubAdapter;
47
51
  import io.sentry.ILogger;
52
+ import io.sentry.ISentryExecutorService;
53
+ import io.sentry.IScope;
48
54
  import io.sentry.ISerializer;
49
55
  import io.sentry.Integration;
50
- import io.sentry.Scope;
51
56
  import io.sentry.Sentry;
52
57
  import io.sentry.SentryDate;
53
58
  import io.sentry.SentryEvent;
59
+ import io.sentry.SentryExecutorService;
54
60
  import io.sentry.SentryLevel;
55
61
  import io.sentry.SentryOptions;
56
62
  import io.sentry.UncaughtExceptionHandlerIntegration;
57
63
  import io.sentry.android.core.AndroidLogger;
64
+ import io.sentry.android.core.AndroidProfiler;
58
65
  import io.sentry.android.core.AnrIntegration;
59
- import io.sentry.android.core.AppStartState;
60
66
  import io.sentry.android.core.BuildConfig;
61
67
  import io.sentry.android.core.BuildInfoProvider;
62
68
  import io.sentry.android.core.CurrentActivityHolder;
@@ -65,13 +71,18 @@ import io.sentry.android.core.NdkIntegration;
65
71
  import io.sentry.android.core.SentryAndroid;
66
72
  import io.sentry.android.core.SentryAndroidOptions;
67
73
  import io.sentry.android.core.ViewHierarchyEventProcessor;
74
+ import io.sentry.android.core.internal.debugmeta.AssetsDebugMetaLoader;
75
+ import io.sentry.android.core.internal.util.SentryFrameMetricsCollector;
76
+ import io.sentry.android.core.performance.AppStartMetrics;
68
77
  import io.sentry.protocol.SdkVersion;
69
78
  import io.sentry.protocol.SentryException;
70
79
  import io.sentry.protocol.SentryPackage;
71
80
  import io.sentry.protocol.User;
72
81
  import io.sentry.protocol.ViewHierarchy;
82
+ import io.sentry.util.DebugMetaPropertiesApplier;
73
83
  import io.sentry.util.JsonSerializationUtils;
74
84
  import io.sentry.vendor.Base64;
85
+ import io.sentry.util.FileUtils;
75
86
 
76
87
  public class RNSentryModuleImpl {
77
88
 
@@ -98,6 +109,23 @@ public class RNSentryModuleImpl {
98
109
 
99
110
  private static final int SCREENSHOT_TIMEOUT_SECONDS = 2;
100
111
 
112
+ /**
113
+ * Profiling traces rate. 101 hz means 101 traces in 1 second. Defaults to 101 to avoid possible
114
+ * lockstep sampling. More on
115
+ * https://stackoverflow.com/questions/45470758/what-is-lockstep-sampling
116
+ */
117
+ private int profilingTracesHz = 101;
118
+
119
+ private AndroidProfiler androidProfiler = null;
120
+
121
+ private boolean isProguardDebugMetaLoaded = false;
122
+ private @Nullable String proguardUuid = null;
123
+ private String cacheDirPath = null;
124
+ private ISentryExecutorService executorService = null;
125
+
126
+ /** Max trace file size in bytes. */
127
+ private long maxTraceFileSize = 5 * 1024 * 1024;
128
+
101
129
  public RNSentryModuleImpl(ReactApplicationContext reactApplicationContext) {
102
130
  packageInfo = getPackageInfo(reactApplicationContext);
103
131
  this.reactApplicationContext = reactApplicationContext;
@@ -261,16 +289,13 @@ public class RNSentryModuleImpl {
261
289
  }
262
290
 
263
291
  public void fetchNativeAppStart(Promise promise) {
264
- final AppStartState appStartInstance = AppStartState.getInstance();
265
- final SentryDate appStartTime = appStartInstance.getAppStartTime();
266
- final Boolean isColdStart = appStartInstance.isColdStart();
292
+ final AppStartMetrics appStartInstance = AppStartMetrics.getInstance();
293
+ final SentryDate appStartTime = appStartInstance.getAppStartTimeSpan().getStartTimestamp();
294
+ final boolean isColdStart = appStartInstance.getAppStartType() == AppStartMetrics.AppStartType.COLD;
267
295
 
268
296
  if (appStartTime == null) {
269
297
  logger.log(SentryLevel.WARNING, "App start won't be sent due to missing appStartTime.");
270
298
  promise.resolve(null);
271
- } else if (isColdStart == null) {
272
- logger.log(SentryLevel.WARNING, "App start won't be sent due to missing isColdStart.");
273
- promise.resolve(null);
274
299
  } else {
275
300
  final double appStartTimestampMs = DateUtils.nanosToMillis(appStartTime.nanoTimestamp());
276
301
 
@@ -398,7 +423,7 @@ public class RNSentryModuleImpl {
398
423
  }
399
424
 
400
425
  try {
401
- doneSignal.await(SCREENSHOT_TIMEOUT_SECONDS, TimeUnit.SECONDS);
426
+ doneSignal.await(SCREENSHOT_TIMEOUT_SECONDS, SECONDS);
402
427
  } catch (InterruptedException e) {
403
428
  logger.log(SentryLevel.ERROR, "Screenshot process was interrupted.");
404
429
  return null;
@@ -616,10 +641,41 @@ public class RNSentryModuleImpl {
616
641
  }
617
642
  }
618
643
 
644
+ private String getProfilingTracesDirPath() {
645
+ if (cacheDirPath == null) {
646
+ cacheDirPath = new File(getReactApplicationContext().getCacheDir(), "sentry/react").getAbsolutePath();
647
+ }
648
+ File profilingTraceDir = new File(cacheDirPath, "profiling_trace");
649
+ profilingTraceDir.mkdirs();
650
+ return profilingTraceDir.getAbsolutePath();
651
+ }
652
+
653
+ private void initializeAndroidProfiler() {
654
+ if (executorService == null) {
655
+ executorService = new SentryExecutorService();
656
+ }
657
+ final String tracesFilesDirPath = getProfilingTracesDirPath();
658
+
659
+ androidProfiler = new AndroidProfiler(
660
+ tracesFilesDirPath,
661
+ (int) SECONDS.toMicros(1) / profilingTracesHz,
662
+ new SentryFrameMetricsCollector(reactApplicationContext, logger, buildInfo),
663
+ executorService,
664
+ logger,
665
+ buildInfo
666
+ );
667
+ }
668
+
619
669
  public WritableMap startProfiling() {
620
670
  final WritableMap result = new WritableNativeMap();
671
+ if (androidProfiler == null) {
672
+ initializeAndroidProfiler();
673
+ }
674
+
621
675
  try {
622
676
  HermesSamplingProfiler.enable();
677
+ androidProfiler.start();
678
+
623
679
  result.putBoolean("started", true);
624
680
  } catch (Throwable e) {
625
681
  result.putBoolean("started", false);
@@ -633,27 +689,26 @@ public class RNSentryModuleImpl {
633
689
  final WritableMap result = new WritableNativeMap();
634
690
  File output = null;
635
691
  try {
692
+ AndroidProfiler.ProfileEndData end = androidProfiler.endAndCollect(false, null);
636
693
  HermesSamplingProfiler.disable();
637
694
 
638
695
  output = File.createTempFile(
639
696
  "sampling-profiler-trace", ".cpuprofile", reactApplicationContext.getCacheDir());
640
-
641
697
  if (isDebug) {
642
698
  logger.log(SentryLevel.INFO, "Profile saved to: " + output.getAbsolutePath());
643
699
  }
644
700
 
645
- try (final BufferedReader br = new BufferedReader(new FileReader(output));) {
646
- HermesSamplingProfiler.dumpSampledTraceToFile(output.getPath());
701
+ HermesSamplingProfiler.dumpSampledTraceToFile(output.getPath());
702
+ result.putString("profile", readStringFromFile(output));
647
703
 
648
- final StringBuilder text = new StringBuilder();
649
- String line;
650
- while ((line = br.readLine()) != null) {
651
- text.append(line);
652
- text.append('\n');
653
- }
704
+ WritableMap androidProfile = new WritableNativeMap();
705
+ byte[] androidProfileBytes = FileUtils.readBytesFromFile(end.traceFile.getPath(), maxTraceFileSize);
706
+ String base64AndroidProfile = Base64.encodeToString(androidProfileBytes, NO_WRAP | NO_PADDING);
654
707
 
655
- result.putString("profile", text.toString());
656
- }
708
+ androidProfile.putString("sampled_profile", base64AndroidProfile);
709
+ androidProfile.putInt("android_api_level", buildInfo.getSdkInfoVersion());
710
+ androidProfile.putString("build_id", getProguardUuid());
711
+ result.putMap("androidProfile", androidProfile);
657
712
  } catch (Throwable e) {
658
713
  result.putString("error", e.toString());
659
714
  } finally {
@@ -671,6 +726,42 @@ public class RNSentryModuleImpl {
671
726
  return result;
672
727
  }
673
728
 
729
+ private @Nullable String getProguardUuid() {
730
+ if (isProguardDebugMetaLoaded) {
731
+ return proguardUuid;
732
+ }
733
+ isProguardDebugMetaLoaded = true;
734
+ final @Nullable List<Properties> debugMetaList = (new AssetsDebugMetaLoader(this.getReactApplicationContext(),
735
+ logger)).loadDebugMeta();
736
+ if (debugMetaList == null) {
737
+ return null;
738
+ }
739
+
740
+ for (Properties debugMeta : debugMetaList) {
741
+ proguardUuid = DebugMetaPropertiesApplier.getProguardUuid(debugMeta);
742
+ if (proguardUuid != null) {
743
+ logger.log(SentryLevel.INFO, "Proguard uuid found: " + proguardUuid);
744
+ return proguardUuid;
745
+ }
746
+ }
747
+
748
+ logger.log(SentryLevel.WARNING, "No proguard uuid found in debug meta properties file!");
749
+ return null;
750
+ }
751
+
752
+ private String readStringFromFile(File path) throws IOException {
753
+ try (final BufferedReader br = new BufferedReader(new FileReader(path));) {
754
+
755
+ final StringBuilder text = new StringBuilder();
756
+ String line;
757
+ while ((line = br.readLine()) != null) {
758
+ text.append(line);
759
+ text.append('\n');
760
+ }
761
+ return text.toString();
762
+ }
763
+ }
764
+
674
765
  public void fetchNativeDeviceContexts(Promise promise) {
675
766
  final @NotNull SentryOptions options = HubAdapter.getInstance().getOptions();
676
767
  if (!(options instanceof SentryAndroidOptions)) {
@@ -684,7 +775,7 @@ public class RNSentryModuleImpl {
684
775
  return;
685
776
  }
686
777
 
687
- final @Nullable Scope currentScope = InternalSentrySdk.getCurrentScope();
778
+ final @Nullable IScope currentScope = InternalSentrySdk.getCurrentScope();
688
779
  final @NotNull Map<String, Object> serialized = InternalSentrySdk.serializeScope(
689
780
  context,
690
781
  (SentryAndroidOptions) options,
@@ -705,8 +796,8 @@ public class RNSentryModuleImpl {
705
796
  }
706
797
  }
707
798
 
708
- public void fetchNativePackageName(Promise promise) {
709
- promise.resolve(packageInfo.packageName);
799
+ public String fetchNativePackageName() {
800
+ return packageInfo.packageName;
710
801
  }
711
802
 
712
803
  private void setEventOriginTag(SentryEvent event) {
@@ -135,12 +135,13 @@ public class RNSentryModule extends NativeRNSentrySpec {
135
135
  }
136
136
 
137
137
  @Override
138
- public void fetchNativePackageName(Promise promise) {
139
- this.impl.fetchNativePackageName(promise);
138
+ public String fetchNativePackageName() {
139
+ return this.impl.fetchNativePackageName();
140
140
  }
141
141
 
142
142
  @Override
143
- public void fetchNativeStackFramesBy(ReadableArray instructionsAddr, Promise promise) {
143
+ public WritableMap fetchNativeStackFramesBy(ReadableArray instructionsAddr) {
144
144
  // Not used on Android
145
+ return null;
145
146
  }
146
147
  }
@@ -133,13 +133,14 @@ public class RNSentryModule extends ReactContextBaseJavaModule {
133
133
  return this.impl.stopProfiling();
134
134
  }
135
135
 
136
- @ReactMethod
137
- public void fetchNativePackageName(Promise promise) {
138
- this.impl.fetchNativePackageName(promise);
136
+ @ReactMethod(isBlockingSynchronousMethod = true)
137
+ public String fetchNativePackageName() {
138
+ return this.impl.fetchNativePackageName();
139
139
  }
140
140
 
141
- @ReactMethod
142
- public void fetchNativeStackFramesBy(ReadableArray instructionsAddr, Promise promise) {
141
+ @ReactMethod(isBlockingSynchronousMethod = true)
142
+ public WritableMap fetchNativeStackFramesBy(ReadableArray instructionsAddr) {
143
143
  // Not used on Android
144
+ return null;
144
145
  }
145
146
  }
@@ -31,10 +31,11 @@ export interface Spec extends TurboModule {
31
31
  stopProfiling(): {
32
32
  profile?: string;
33
33
  nativeProfile?: UnsafeObject;
34
+ androidProfile?: UnsafeObject;
34
35
  error?: string;
35
36
  };
36
- fetchNativePackageName(): Promise<string | undefined | null>;
37
- fetchNativeStackFramesBy(instructionsAddr: number[]): Promise<NativeStackFrames | undefined | null>;
37
+ fetchNativePackageName(): string | undefined | null;
38
+ fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | undefined | null;
38
39
  }
39
40
  export type NativeStackFrame = {
40
41
  platform: string;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeRNSentry.d.ts","sourceRoot":"","sources":["../../src/js/NativeRNSentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAIjE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,aAAa,CAAC,UAAU,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9C,eAAe,CACb,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;QACP,KAAK,EAAE,OAAO,CAAC;KAChB,GACA,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,iBAAiB,IAAI,OAAO,CAAC,gBAAgB,EAAE,GAAG,SAAS,GAAG,IAAI,CAAC,CAAC;IACpE,gBAAgB,IAAI,IAAI,CAAC;IACzB,KAAK,IAAI,IAAI,CAAC;IACd,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,2BAA2B,IAAI,IAAI,CAAC;IACpC,kBAAkB,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACrD,kBAAkB,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAC9C,yBAAyB,IAAI,O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M,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,EAAE,CAAC;CACL,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;;AAGF,wBAAkE"}
@@ -1 +1 @@
1
- {"version":3,"file":"NativeRNSentry.js","sourceRoot":"","sources":["../../src/js/NativeRNSentry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAyInD,2DAA2D;AAC3D,eAAe,mBAAmB,CAAC,YAAY,CAAO,UAAU,CAAC,CAAC","sourcesContent":["import type { Package } from '@sentry/types';\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\nimport type { UnsafeObject } from './utils/rnlibrariesinterface';\n\n// There has to be only one interface and it has to be named `Spec`\n// Only extra allowed definitions are types (probably codegen bug)\nexport interface Spec extends TurboModule {\n addBreadcrumb(breadcrumb: UnsafeObject): void;\n captureEnvelope(\n bytes: string,\n options: {\n store: boolean;\n },\n ): Promise<boolean>;\n captureScreenshot(): Promise<NativeScreenshot[] | undefined | null>;\n clearBreadcrumbs(): void;\n crash(): void;\n closeNativeSdk(): Promise<void>;\n disableNativeFramesTracking(): void;\n fetchNativeRelease(): Promise<NativeReleaseResponse>;\n fetchNativeSdkInfo(): Promise<Package | null>;\n fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse | null>;\n fetchNativeAppStart(): Promise<NativeAppStartResponse | null>;\n fetchNativeFrames(): Promise<NativeFramesResponse | null>;\n initNativeSdk(options: UnsafeObject): Promise<boolean>;\n setUser(defaultUserKeys: UnsafeObject | null, otherUserKeys: UnsafeObject | null): void;\n setContext(key: string, value: UnsafeObject | null): void;\n setExtra(key: string, value: string): void;\n setTag(key: string, value: string): void;\n enableNativeFramesTracking(): void;\n fetchModules(): Promise<string | undefined | null>;\n fetchViewHierarchy(): Promise<number[] | undefined | null>;\n startProfiling(): { started?: boolean; error?: string };\n stopProfiling(): { profile?: string; nativeProfile?: UnsafeObject; error?: string };\n fetchNativePackageName(): Promise<string | undefined | null>;\n fetchNativeStackFramesBy(instructionsAddr: number[]): Promise<NativeStackFrames | undefined | null>;\n}\n\nexport type NativeStackFrame = {\n platform: string;\n /**\n * The instruction address of this frame.\n * Formatted as hex with 0x prefix.\n */\n instruction_addr: string;\n package?: string;\n /**\n * The debug image address of this frame.\n * Formatted as hex with 0x prefix.\n */\n image_addr?: string;\n in_app?: boolean;\n /**\n * The symbol name of this frame.\n * If symbolicated locally.\n */\n function?: string;\n /**\n * The symbol address of this frame.\n * If symbolicated locally.\n * Formatted as hex with 0x prefix.\n */\n symbol_addr?: string;\n};\n\nexport type NativeDebugImage = {\n name?: string;\n type?: string;\n uuid?: string;\n debug_id?: string;\n image_addr?: string;\n image_size?: number;\n code_file?: string;\n image_vmaddr?: string;\n};\n\nexport type NativeStackFrames = {\n frames: NativeStackFrame[];\n debugMetaImages?: NativeDebugImage[];\n};\n\nexport type NativeAppStartResponse = {\n isColdStart: boolean;\n appStartTime: number;\n didFetchAppStart: boolean;\n};\n\nexport type NativeFramesResponse = {\n totalFrames: number;\n slowFrames: number;\n frozenFrames: number;\n};\n\nexport type NativeReleaseResponse = {\n build: string;\n id: string;\n version: string;\n};\n\n/**\n * This type describes serialized scope from sentry-cocoa and sentry-android\n * https://github.com/getsentry/sentry-cocoa/blob/master/Sources/Sentry/SentryScope.m\n * https://github.com/getsentry/sentry-java/blob/a461f7e125b65240004e6162b341f383ce2e1394/sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java#L32\n */\nexport type NativeDeviceContextsResponse = {\n [key: string]: unknown;\n tags?: Record<string, string>;\n extra?: Record<string, unknown>;\n contexts?: Record<string, Record<string, unknown>>;\n user?: {\n userId?: string;\n email?: string;\n username?: string;\n ipAddress?: string;\n segment?: string;\n data?: Record<string, unknown>;\n };\n dist?: string;\n environment?: string;\n fingerprint?: string[];\n level?: string;\n breadcrumbs?: {\n level?: string;\n timestamp?: string;\n category?: string;\n type?: string;\n message?: string;\n data?: Record<string, unknown>;\n }[];\n};\n\nexport type NativeScreenshot = {\n data: number[];\n contentType: string;\n filename: string;\n};\n\n// The export must be here to pass codegen even if not used\nexport default TurboModuleRegistry.getEnforcing<Spec>('RNSentry');\n"]}
1
+ {"version":3,"file":"NativeRNSentry.js","sourceRoot":"","sources":["../../src/js/NativeRNSentry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AA8InD,2DAA2D;AAC3D,eAAe,mBAAmB,CAAC,YAAY,CAAO,UAAU,CAAC,CAAC","sourcesContent":["import type { Package } from '@sentry/types';\nimport type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\n\nimport type { UnsafeObject } from './utils/rnlibrariesinterface';\n\n// There has to be only one interface and it has to be named `Spec`\n// Only extra allowed definitions are types (probably codegen bug)\nexport interface Spec extends TurboModule {\n addBreadcrumb(breadcrumb: UnsafeObject): void;\n captureEnvelope(\n bytes: string,\n options: {\n store: boolean;\n },\n ): Promise<boolean>;\n captureScreenshot(): Promise<NativeScreenshot[] | undefined | null>;\n clearBreadcrumbs(): void;\n crash(): void;\n closeNativeSdk(): Promise<void>;\n disableNativeFramesTracking(): void;\n fetchNativeRelease(): Promise<NativeReleaseResponse>;\n fetchNativeSdkInfo(): Promise<Package | null>;\n fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse | null>;\n fetchNativeAppStart(): Promise<NativeAppStartResponse | null>;\n fetchNativeFrames(): Promise<NativeFramesResponse | null>;\n initNativeSdk(options: UnsafeObject): Promise<boolean>;\n setUser(defaultUserKeys: UnsafeObject | null, otherUserKeys: UnsafeObject | null): void;\n setContext(key: string, value: UnsafeObject | null): void;\n setExtra(key: string, value: string): void;\n setTag(key: string, value: string): void;\n enableNativeFramesTracking(): void;\n fetchModules(): Promise<string | undefined | null>;\n fetchViewHierarchy(): Promise<number[] | undefined | null>;\n startProfiling(): { started?: boolean; error?: string };\n stopProfiling(): {\n profile?: string;\n nativeProfile?: UnsafeObject;\n androidProfile?: UnsafeObject;\n error?: string;\n };\n fetchNativePackageName(): string | undefined | null;\n fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | undefined | null;\n}\n\nexport type NativeStackFrame = {\n platform: string;\n /**\n * The instruction address of this frame.\n * Formatted as hex with 0x prefix.\n */\n instruction_addr: string;\n package?: string;\n /**\n * The debug image address of this frame.\n * Formatted as hex with 0x prefix.\n */\n image_addr?: string;\n in_app?: boolean;\n /**\n * The symbol name of this frame.\n * If symbolicated locally.\n */\n function?: string;\n /**\n * The symbol address of this frame.\n * If symbolicated locally.\n * Formatted as hex with 0x prefix.\n */\n symbol_addr?: string;\n};\n\nexport type NativeDebugImage = {\n name?: string;\n type?: string;\n uuid?: string;\n debug_id?: string;\n image_addr?: string;\n image_size?: number;\n code_file?: string;\n image_vmaddr?: string;\n};\n\nexport type NativeStackFrames = {\n frames: NativeStackFrame[];\n debugMetaImages?: NativeDebugImage[];\n};\n\nexport type NativeAppStartResponse = {\n isColdStart: boolean;\n appStartTime: number;\n didFetchAppStart: boolean;\n};\n\nexport type NativeFramesResponse = {\n totalFrames: number;\n slowFrames: number;\n frozenFrames: number;\n};\n\nexport type NativeReleaseResponse = {\n build: string;\n id: string;\n version: string;\n};\n\n/**\n * This type describes serialized scope from sentry-cocoa and sentry-android\n * https://github.com/getsentry/sentry-cocoa/blob/master/Sources/Sentry/SentryScope.m\n * https://github.com/getsentry/sentry-java/blob/a461f7e125b65240004e6162b341f383ce2e1394/sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java#L32\n */\nexport type NativeDeviceContextsResponse = {\n [key: string]: unknown;\n tags?: Record<string, string>;\n extra?: Record<string, unknown>;\n contexts?: Record<string, Record<string, unknown>>;\n user?: {\n userId?: string;\n email?: string;\n username?: string;\n ipAddress?: string;\n segment?: string;\n data?: Record<string, unknown>;\n };\n dist?: string;\n environment?: string;\n fingerprint?: string[];\n level?: string;\n breadcrumbs?: {\n level?: string;\n timestamp?: string;\n category?: string;\n type?: string;\n message?: string;\n data?: Record<string, unknown>;\n }[];\n};\n\nexport type NativeScreenshot = {\n data: number[];\n contentType: string;\n filename: string;\n};\n\n// The export must be here to pass codegen even if not used\nexport default TurboModuleRegistry.getEnforcing<Spec>('RNSentry');\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAGV,QAAQ,EACR,KAAK,EACL,SAAS,EAGT,aAAa,EAEb,YAAY,EACb,MAAM,eAAe,CAAC;AAMvB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAO1D;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,UAAU,CAAC,wBAAwB,CAAC;IACzE,OAAO,CAAC,eAAe,CAAY;IAEnC;;;OAGG;gBACgB,OAAO,EAAE,wBAAwB;IAUpD;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AAa,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAmBrG;;;OAGG;IACI,WAAW,IAAI,IAAI;IAI1B;;OAEG;IACI,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC;IAOpC;;OAEG;IACI,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IASxD;;OAEG;IACI,iBAAiB,IAAI,IAAI;IAahC;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IA+BjD;;OAEG;IACH,OAAO,CAAC,cAAc;IAmBtB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAShC;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAa9B"}
package/dist/js/client.js CHANGED
@@ -1,4 +1,3 @@
1
- import { __awaiter } from "tslib";
2
1
  import { eventFromException, eventFromMessage } from '@sentry/browser';
3
2
  import { BaseClient } from '@sentry/core';
4
3
  import { dateTimestampInSeconds, logger, SentryError } from '@sentry/utils';
@@ -27,7 +26,7 @@ export class ReactNativeClient extends BaseClient {
27
26
  options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;
28
27
  super(options);
29
28
  this._outcomesBuffer = [];
30
- void this._initNativeSdk();
29
+ this._initNativeSdk();
31
30
  }
32
31
  /**
33
32
  * @inheritDoc
@@ -131,23 +130,19 @@ export class ReactNativeClient extends BaseClient {
131
130
  * Starts native client with dsn and options
132
131
  */
133
132
  _initNativeSdk() {
134
- var _a, _b;
135
- return __awaiter(this, void 0, void 0, function* () {
136
- let didCallNativeInit = false;
137
- try {
138
- didCallNativeInit = yield NATIVE.initNativeSdk(this._options);
139
- }
140
- catch (_) {
141
- this._showCannotConnectDialog();
142
- }
143
- finally {
144
- try {
145
- (_b = (_a = this._options).onReady) === null || _b === void 0 ? void 0 : _b.call(_a, { didCallNativeInit });
146
- }
147
- catch (error) {
148
- logger.error('The OnReady callback threw an error: ', error);
149
- }
150
- }
133
+ NATIVE.initNativeSdk(this._options)
134
+ .then((result) => {
135
+ return result;
136
+ }, () => {
137
+ this._showCannotConnectDialog();
138
+ return false;
139
+ })
140
+ .then((didCallNativeInit) => {
141
+ var _a, _b;
142
+ (_b = (_a = this._options).onReady) === null || _b === void 0 ? void 0 : _b.call(_a, { didCallNativeInit });
143
+ })
144
+ .then(undefined, error => {
145
+ logger.error('The OnReady callback threw an error: ', error);
151
146
  });
152
147
  }
153
148
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,OAAO,iBAAkB,SAAQ,UAAoC;IAGzE;;;OAGG;IACH,YAAmB,OAAiC;QAClD,sBAAsB,EAAE,CAAC;QACzB,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;QAC5C,OAAO,CAAC,SAAS,CAAC,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,c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uC,EAAE,KAAK,CAAC,CAAC;iBAC9D;aACF;;KACF;IAED;;OAEG;IACK,wBAAwB;QAC9B,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAC/C,KAAK,CAAC,KAAK,CACT,QAAQ,EACR,qOAAqO,CACtO,CAAC;SACH;IACH,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,QAAmB,EAAE,QAA8B;QAC/E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,MAAM,gBAAgB,GAAqB;gBACzC,EAAE,IAAI,EAAE,eAAe,EAAE;gBACzB;oBACE,SAAS,EAAE,sBAAsB,EAAE;oBACnC,gBAAgB,EAAE,QAAQ;iBAC3B;aACF,CAAC;YAEF,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport { BaseClient } from '@sentry/core';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Exception,\n Outcome,\n SeverityLevel,\n Thread,\n UserFeedback,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, logger, SentryError } from '@sentry/utils';\nimport { Alert } from 'react-native';\n\nimport { createIntegration } from './integrations/factory';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport type { ReactNativeClientOptions } from './options';\nimport { ReactNativeTracing } from './tracing';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n ignoreRequireCycleLogs();\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n super(options);\n\n this._outcomesBuffer = [];\n void this._initNativeSdk();\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint: EventHint = {}): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace).then(\n (event: Event) => {\n // TMP! Remove this function once JS SDK uses threads for messages\n if (!event.exception?.values || event.exception.values.length <= 0) {\n return event;\n }\n const values = event.exception.values.map(\n (exception: Exception): Thread => ({\n stacktrace: exception.stacktrace,\n }),\n );\n (event as { threads?: { values: Thread[] } }).threads = { values };\n delete event.exception;\n return event;\n },\n );\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: this._options.tunnel,\n });\n this._sendEnvelope(envelope);\n }\n\n /**\n * Sets up the integrations\n */\n public setupIntegrations(): void {\n super.setupIntegrations();\n const tracing = this.getIntegration(ReactNativeTracing);\n const routingName = tracing?.options.routingInstrumentation?.name;\n if (routingName) {\n this.addIntegration(createIntegration(routingName));\n }\n const enableUserInteractionTracing = tracing?.options.enableUserInteractionTracing;\n if (enableUserInteractionTracing) {\n this.addIntegration(createIntegration('ReactNativeUserInteractionTracing'));\n }\n }\n\n /**\n * @inheritdoc\n */\n protected _sendEnvelope(envelope: Envelope): void {\n const outcomes = this._clearOutcomes();\n this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);\n\n if (this._options.sendClientReports) {\n this._attachClientReportTo(this._outcomesBuffer, envelope as ClientReportEnvelope);\n }\n\n let shouldClearOutcomesBuffer = true;\n if (this._transport && this._dsn) {\n this.emit('beforeEnvelope', envelope);\n\n this._transport.send(envelope).then(null, reason => {\n if (reason instanceof SentryError) {\n // SentryError is thrown by SyncPromise\n shouldClearOutcomesBuffer = false;\n // If this is called asynchronously we want the _outcomesBuffer to be cleared\n logger.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n logger.error('Error while sending event:', reason);\n }\n });\n } else {\n logger.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n }\n\n /**\n * Starts native client with dsn and options\n */\n private async _initNativeSdk(): Promise<void> {\n let didCallNativeInit = false;\n\n try {\n didCallNativeInit = await NATIVE.initNativeSdk(this._options);\n } catch (_) {\n this._showCannotConnectDialog();\n } finally {\n try {\n this._options.onReady?.({ didCallNativeInit });\n } catch (error) {\n logger.error('The OnReady callback threw an error: ', error);\n }\n }\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/#linking for more details.',\n );\n }\n }\n\n /**\n * Attaches a client report from outcomes to the envelope.\n */\n private _attachClientReportTo(outcomes: Outcome[], envelope: ClientReportEnvelope): void {\n if (outcomes.length > 0) {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: dateTimestampInSeconds(),\n discarded_events: outcomes,\n },\n ];\n\n envelope[items].push(clientReportItem);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,OAAO,iBAAkB,SAAQ,UAAoC;IAGzE;;;OAGG;IACH,YAAmB,OAAiC;QAClD,sBAAsB,EAAE,CAAC;QACzB,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;QAC5C,OAAO,CAAC,SAAS,CAAC,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,cAAc,CAAC;QAChE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,kBAAkB,CAAC,SAAkB,EAAE,OAAkB,E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AAQ,CAAC,kBAAkB,EAAE;YAC/C,KAAK,CAAC,KAAK,CACT,QAAQ,EACR,qOAAqO,CACtO,CAAC;SACH;IACH,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,QAAmB,EAAE,QAA8B;QAC/E,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACvB,MAAM,gBAAgB,GAAqB;gBACzC,EAAE,IAAI,EAAE,eAAe,EAAE;gBACzB;oBACE,SAAS,EAAE,sBAAsB,EAAE;oBACnC,gBAAgB,EAAE,QAAQ;iBAC3B;aACF,CAAC;YAEF,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport { BaseClient } from '@sentry/core';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Exception,\n Outcome,\n SeverityLevel,\n Thread,\n UserFeedback,\n} from '@sentry/types';\nimport { dateTimestampInSeconds, logger, SentryError } from '@sentry/utils';\nimport { Alert } from 'react-native';\n\nimport { createIntegration } from './integrations/factory';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport type { ReactNativeClientOptions } from './options';\nimport { ReactNativeTracing } from './tracing';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n ignoreRequireCycleLogs();\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n super(options);\n\n this._outcomesBuffer = [];\n this._initNativeSdk();\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint: EventHint = {}): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(message: string, level?: SeverityLevel, hint?: EventHint): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace).then(\n (event: Event) => {\n // TMP! Remove this function once JS SDK uses threads for messages\n if (!event.exception?.values || event.exception.values.length <= 0) {\n return event;\n }\n const values = event.exception.values.map(\n (exception: Exception): Thread => ({\n stacktrace: exception.stacktrace,\n }),\n );\n (event as { threads?: { values: Thread[] } }).threads = { values };\n delete event.exception;\n return event;\n },\n );\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: this._options.tunnel,\n });\n this._sendEnvelope(envelope);\n }\n\n /**\n * Sets up the integrations\n */\n public setupIntegrations(): void {\n super.setupIntegrations();\n const tracing = this.getIntegration(ReactNativeTracing);\n const routingName = tracing?.options.routingInstrumentation?.name;\n if (routingName) {\n this.addIntegration(createIntegration(routingName));\n }\n const enableUserInteractionTracing = tracing?.options.enableUserInteractionTracing;\n if (enableUserInteractionTracing) {\n this.addIntegration(createIntegration('ReactNativeUserInteractionTracing'));\n }\n }\n\n /**\n * @inheritdoc\n */\n protected _sendEnvelope(envelope: Envelope): void {\n const outcomes = this._clearOutcomes();\n this._outcomesBuffer = mergeOutcomes(this._outcomesBuffer, outcomes);\n\n if (this._options.sendClientReports) {\n this._attachClientReportTo(this._outcomesBuffer, envelope as ClientReportEnvelope);\n }\n\n let shouldClearOutcomesBuffer = true;\n if (this._transport && this._dsn) {\n this.emit('beforeEnvelope', envelope);\n\n this._transport.send(envelope).then(null, reason => {\n if (reason instanceof SentryError) {\n // SentryError is thrown by SyncPromise\n shouldClearOutcomesBuffer = false;\n // If this is called asynchronously we want the _outcomesBuffer to be cleared\n logger.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n logger.error('Error while sending event:', reason);\n }\n });\n } else {\n logger.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk(this._options)\n .then(\n (result: boolean) => {\n return result;\n },\n () => {\n this._showCannotConnectDialog();\n return false;\n },\n )\n .then((didCallNativeInit: boolean) => {\n this._options.onReady?.({ didCallNativeInit });\n })\n .then(undefined, error => {\n logger.error('The OnReady callback threw an error: ', error);\n });\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/#linking for more details.',\n );\n }\n }\n\n /**\n * Attaches a client report from outcomes to the envelope.\n */\n private _attachClientReportTo(outcomes: Outcome[], envelope: ClientReportEnvelope): void {\n if (outcomes.length > 0) {\n const clientReportItem: ClientReportItem = [\n { type: 'client_report' },\n {\n timestamp: dateTimestampInSeconds(),\n discarded_events: outcomes,\n },\n ];\n\n envelope[items].push(clientReportItem);\n }\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  export type { Breadcrumb, Request, SdkInfo, Event, Exception, StackFrame, Stacktrace, Thread, User, UserFeedback, } from '@sentry/types';
2
- export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startTransaction, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, } from '@sentry/core';
2
+ export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startTransaction, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, spanToJSON, spanIsSampled, setMeasurement, getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metrics, } from '@sentry/core';
3
3
  export { Integrations as BrowserIntegrations, ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
4
4
  export { lastEventId } from '@sentry/browser';
5
5
  import * as Integrations from './integrations';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,GACd,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,aAAa,EACb,iBAAiB,EACj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ACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,cAAc,EAGd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,OAAO,GACR,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EACL,IAAI,EACJ,IAAI,EAEJ,OAAO,EAEP,UAAU,EACV,WAAW,EACX,KAAK,EACL,KAAK,EACL,mBAAmB,EACnB,SAAS,EACT,cAAc,GACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,kBAAkB,EAClB,gCAAgC,EAEhC,gCAAgC,EAChC,8BAA8B,EAC9B,oCAAoC,EACpC,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,iCAAiC,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC"}
package/dist/js/index.js CHANGED
@@ -1,4 +1,8 @@
1
- export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startTransaction, startInactiveSpan, startSpan, startSpanManual, getActiveSpan, } from '@sentry/core';
1
+ export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startTransaction,
2
+ // v8 spans
3
+ startInactiveSpan, startSpan, startSpanManual, getActiveSpan, spanToJSON, spanIsSampled, setMeasurement,
4
+ // v8 scopes
5
+ getCurrentScope, getGlobalScope, getIsolationScope, getClient, setCurrentClient, addEventProcessor, metrics, } from '@sentry/core';
2
6
  import { _addTracingExtensions } from './tracing/addTracingExtensions';
3
7
  _addTracingExtensions();
4
8
  export { Integrations as BrowserIntegrations, ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';