@sentry/react-native 7.8.0 → 7.9.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 (40) hide show
  1. package/RNSentry.podspec +1 -1
  2. package/android/build.gradle +1 -1
  3. package/android/libs/replay-stubs.jar +0 -0
  4. package/android/replay-stubs/build.gradle +1 -1
  5. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +65 -5
  6. package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
  7. package/dist/js/client.d.ts.map +1 -1
  8. package/dist/js/client.js +2 -2
  9. package/dist/js/client.js.map +1 -1
  10. package/dist/js/integrations/nativelinkederrors.js +3 -2
  11. package/dist/js/integrations/nativelinkederrors.js.map +1 -1
  12. package/dist/js/options.d.ts +49 -1
  13. package/dist/js/options.d.ts.map +1 -1
  14. package/dist/js/options.js.map +1 -1
  15. package/dist/js/replay/mobilereplay.d.ts +26 -0
  16. package/dist/js/replay/mobilereplay.d.ts.map +1 -1
  17. package/dist/js/replay/mobilereplay.js +14 -0
  18. package/dist/js/replay/mobilereplay.js.map +1 -1
  19. package/dist/js/tools/metroMiddleware.d.ts +1 -1
  20. package/dist/js/tools/metroMiddleware.d.ts.map +1 -1
  21. package/dist/js/tools/metroMiddleware.js +2 -2
  22. package/dist/js/tools/metroMiddleware.js.map +1 -1
  23. package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
  24. package/dist/js/tracing/integrations/appStart.js +12 -7
  25. package/dist/js/tracing/integrations/appStart.js.map +1 -1
  26. package/dist/js/version.d.ts +1 -1
  27. package/dist/js/version.js +1 -1
  28. package/dist/js/version.js.map +1 -1
  29. package/dist/js/wrapper.d.ts +2 -1
  30. package/dist/js/wrapper.d.ts.map +1 -1
  31. package/dist/js/wrapper.js +5 -1
  32. package/dist/js/wrapper.js.map +1 -1
  33. package/ios/RNSentry.mm +13 -0
  34. package/ios/RNSentryReplay.mm +5 -0
  35. package/ios/RNSentryVersion.m +1 -1
  36. package/package.json +10 -10
  37. package/ts3.8/dist/js/options.d.ts +49 -1
  38. package/ts3.8/dist/js/replay/mobilereplay.d.ts +26 -0
  39. package/ts3.8/dist/js/version.d.ts +1 -1
  40. package/ts3.8/dist/js/wrapper.d.ts +2 -1
package/RNSentry.podspec CHANGED
@@ -46,7 +46,7 @@ Pod::Spec.new do |s|
46
46
 
47
47
  s.compiler_flags = other_cflags
48
48
 
49
- s.dependency 'Sentry/HybridSDK', '8.57.3'
49
+ s.dependency 'Sentry/HybridSDK', '8.58.0'
50
50
 
51
51
  if defined? install_modules_dependencies
52
52
  # Default React Native dependencies for 0.71 and above (new and legacy architecture)
@@ -55,5 +55,5 @@ android {
55
55
  dependencies {
56
56
  compileOnly files('libs/replay-stubs.jar')
57
57
  implementation 'com.facebook.react:react-native:+'
58
- api 'io.sentry:sentry-android:8.29.0'
58
+ api 'io.sentry:sentry-android:8.30.0'
59
59
  }
Binary file
@@ -18,5 +18,5 @@ tasks.named('jar', Jar) {
18
18
  }
19
19
 
20
20
  dependencies {
21
- compileOnly 'io.sentry:sentry:8.29.0'
21
+ compileOnly 'io.sentry:sentry:8.30.0'
22
22
  }
@@ -36,6 +36,7 @@ import io.sentry.IScope;
36
36
  import io.sentry.ISentryExecutorService;
37
37
  import io.sentry.ISerializer;
38
38
  import io.sentry.Integration;
39
+ import io.sentry.ProfileLifecycle;
39
40
  import io.sentry.ScopesAdapter;
40
41
  import io.sentry.ScreenshotStrategyType;
41
42
  import io.sentry.Sentry;
@@ -324,7 +325,8 @@ public class RNSentryModuleImpl {
324
325
 
325
326
  SentryReplayOptions replayOptions = getReplayOptions(rnOptions);
326
327
  options.setSessionReplay(replayOptions);
327
- // Check if the replay integration is available on the classpath. It's already kept from R8
328
+ // Check if the replay integration is available on the classpath. It's already
329
+ // kept from R8
328
330
  // shrinking by sentry-android-core
329
331
  final boolean isReplayAvailable =
330
332
  loadClass.isClassAvailable("io.sentry.android.replay.ReplayIntegration", logger);
@@ -333,6 +335,9 @@ public class RNSentryModuleImpl {
333
335
  initFragmentReplayTracking();
334
336
  }
335
337
 
338
+ // Configure Android UI Profiling
339
+ configureAndroidProfiling(options, rnOptions);
340
+
336
341
  // Exclude Dev Server and Sentry Dsn request from Breadcrumbs
337
342
  String dsn = getURLFromDSN(rnOptions.getString("dsn"));
338
343
  String devServerUrl = rnOptions.getString("devServerUrl");
@@ -482,17 +487,70 @@ public class RNSentryModuleImpl {
482
487
  }
483
488
  }
484
489
 
490
+ private void configureAndroidProfiling(
491
+ @NotNull SentryAndroidOptions options, @NotNull ReadableMap rnOptions) {
492
+ if (!rnOptions.hasKey("_experiments")) {
493
+ return;
494
+ }
495
+
496
+ @Nullable final ReadableMap experiments = rnOptions.getMap("_experiments");
497
+ if (experiments == null || !experiments.hasKey("androidProfilingOptions")) {
498
+ return;
499
+ }
500
+
501
+ @Nullable
502
+ final ReadableMap androidProfilingOptions = experiments.getMap("androidProfilingOptions");
503
+ if (androidProfilingOptions == null) {
504
+ return;
505
+ }
506
+
507
+ // Set profile session sample rate
508
+ if (androidProfilingOptions.hasKey("profileSessionSampleRate")) {
509
+ final double profileSessionSampleRate =
510
+ androidProfilingOptions.getDouble("profileSessionSampleRate");
511
+ options.setProfileSessionSampleRate(profileSessionSampleRate);
512
+ logger.log(
513
+ SentryLevel.INFO,
514
+ String.format(
515
+ "Android UI Profiling profileSessionSampleRate set to: %.2f",
516
+ profileSessionSampleRate));
517
+ }
518
+
519
+ // Set profiling lifecycle mode
520
+ if (androidProfilingOptions.hasKey("lifecycle")) {
521
+ final String lifecycle = androidProfilingOptions.getString("lifecycle");
522
+ if ("manual".equalsIgnoreCase(lifecycle)) {
523
+ options.setProfileLifecycle(ProfileLifecycle.MANUAL);
524
+ logger.log(SentryLevel.INFO, "Android UI Profile Lifecycle set to MANUAL");
525
+ } else if ("trace".equalsIgnoreCase(lifecycle)) {
526
+ options.setProfileLifecycle(ProfileLifecycle.TRACE);
527
+ logger.log(SentryLevel.INFO, "Android UI Profile Lifecycle set to TRACE");
528
+ }
529
+ }
530
+
531
+ // Set start on app start
532
+ if (androidProfilingOptions.hasKey("startOnAppStart")) {
533
+ final boolean startOnAppStart = androidProfilingOptions.getBoolean("startOnAppStart");
534
+ options.setStartProfilerOnAppStart(startOnAppStart);
535
+ logger.log(
536
+ SentryLevel.INFO,
537
+ String.format("Android UI Profiling startOnAppStart set to %b", startOnAppStart));
538
+ }
539
+ }
540
+
485
541
  public void crash() {
486
542
  throw new RuntimeException("TEST - Sentry Client Crash (only works in release mode)");
487
543
  }
488
544
 
489
545
  public void addListener(String eventType) {
490
- // Is must be defined otherwise the generated interface from TS won't be fulfilled
546
+ // Is must be defined otherwise the generated interface from TS won't be
547
+ // fulfilled
491
548
  logger.log(SentryLevel.ERROR, "addListener of NativeEventEmitter can't be used on Android!");
492
549
  }
493
550
 
494
551
  public void removeListeners(double id) {
495
- // Is must be defined otherwise the generated interface from TS won't be fulfilled
552
+ // Is must be defined otherwise the generated interface from TS won't be
553
+ // fulfilled
496
554
  logger.log(
497
555
  SentryLevel.ERROR, "removeListeners of NativeEventEmitter can't be used on Android!");
498
556
  }
@@ -557,7 +615,8 @@ public class RNSentryModuleImpl {
557
615
  // When activity is destroyed but the application process is kept alive
558
616
  // the next activity creation is considered warm start.
559
617
  // The app start metrics will be updated by the the Android SDK.
560
- // To let the RN JS layer know these are new start data we compare the start timestamps.
618
+ // To let the RN JS layer know these are new start data we compare the start
619
+ // timestamps.
561
620
  lastStartTimestampMs = currentStartTimestampMs;
562
621
 
563
622
  // Clears start metrics, making them ready for recording warm app start
@@ -1292,7 +1351,8 @@ public class RNSentryModuleImpl {
1292
1351
  }
1293
1352
  }
1294
1353
  if (strErrors != null) {
1295
- // Use the same behaviour of JavaScript instead of Android when dealing with strings.
1354
+ // Use the same behaviour of JavaScript instead of Android when dealing with
1355
+ // strings.
1296
1356
  for (int i = 0; i < strErrors.size(); i++) {
1297
1357
  String pattern = ".*" + Pattern.quote(strErrors.getString(i)) + ".*";
1298
1358
  list.add(pattern);
@@ -2,7 +2,7 @@ package io.sentry.react;
2
2
 
3
3
  class RNSentryVersion {
4
4
  static final String REACT_NATIVE_SDK_PACKAGE_NAME = "npm:@sentry/react-native";
5
- static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "7.8.0";
5
+ static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "7.9.0";
6
6
  static final String NATIVE_SDK_NAME = "sentry.native.android.react-native";
7
7
  static final String ANDROID_SDK_NAME = "sentry.java.android.react-native";
8
8
  static final String REACT_NATIVE_SDK_NAME = "sentry.javascript.react-native";
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,QAAQ,EACR,KAAK,EACL,SAAS,EAET,aAAa,EACb,4BAA4B,EAC5B,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,MAAM,EAIP,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAW1D;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,MAAM,CAAC,wBAAwB,CAAC;IACrE,OAAO,CAAC,eAAe,CAAY;IACnC,OAAO,CAAC,oBAAoB,CAA4C;IAExE;;;OAGG;gBACgB,OAAO,EAAE,wBAAwB;IAsDpD;;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,GAAE,SAAc,GAAG,WAAW,CAAC,KAAK,CAAC;IAIvF;;OAEG;IACI,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAIrG;;;OAGG;IACI,WAAW,IAAI,IAAI;IAI1B;;OAEG;IACI,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC;IAOpC;;;OAGG;IACI,mBAAmB,CAAC,QAAQ,EAAE,Y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AAK,IAAI,WAAW,CAAC,OAAO,CAAC;IAOpC;;;OAGG;IACI,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IAUxD;;OAEG;IACI,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC,4BAA4B,CAAC;IAiClF;;OAEG;IACI,IAAI,IAAI,IAAI;IAKnB;;;;OAIG;IACI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,IAAI;IAKtD;;;;OAIG;IACI,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAKnD;;OAEG;IACH,OAAO,CAAC,cAAc;IA8BtB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAShC;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAa9B"}
package/dist/js/client.js CHANGED
@@ -161,11 +161,11 @@ export class ReactNativeClient extends Client {
161
161
  * Starts native client with dsn and options
162
162
  */
163
163
  _initNativeSdk() {
164
- var _a;
164
+ var _a, _b;
165
165
  NATIVE.initNativeSdk(Object.assign(Object.assign({}, this._options), { defaultSidecarUrl: getDefaultSidecarUrl(), devServerUrl: ((_a = getDevServer()) === null || _a === void 0 ? void 0 : _a.url) || '', mobileReplayOptions: this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] &&
166
166
  'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME]
167
167
  ? this._integrations[MOBILE_REPLAY_INTEGRATION_NAME].options
168
- : undefined }))
168
+ : undefined, androidProfilingOptions: (_b = this._options._experiments) === null || _b === void 0 ? void 0 : _b.androidProfilingOptions }))
169
169
  .then((result) => {
170
170
  return result;
171
171
  }, () => {
@@ -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;AAYvE,O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ACnC,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 type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Outcome,\n SeverityLevel,\n TransportMakeRequestResponse,\n UserFeedback,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n addAutoIpAddressToSession,\n Client,\n dateTimestampInSeconds,\n debug,\n SentryError,\n} from '@sentry/core';\nimport { Alert } from 'react-native';\nimport { getDevServer } from './integrations/debugsymbolicatorutils';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport { getDefaultSidecarUrl } from './integrations/spotlight';\nimport type { ReactNativeClientOptions } from './options';\nimport type { mobileReplayIntegration } from './replay/mobilereplay';\nimport { MOBILE_REPLAY_INTEGRATION_NAME } from './replay/mobilereplay';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { ReactNativeLibraries } from './utils/rnlibraries';\nimport { NATIVE } from './wrapper';\n\nconst DEFAULT_FLUSH_INTERVAL = 5000;\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 Client<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n private _logFlushIdleTimeout: ReturnType<typeof setTimeout> | undefined;\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(ReactNativeLibraries.ReactNativeVersion?.version);\n options._metadata = {\n ...options._metadata,\n sdk: {\n ...(options._metadata?.sdk || defaultSdkInfo),\n settings: {\n // Only allow IP inferral by Relay if sendDefaultPii is true\n infer_ip: options.sendDefaultPii ? 'auto' : 'never',\n ...options._metadata?.sdk?.settings,\n },\n },\n };\n\n // We default this to true, as it is the safer scenario\n options.parentSpanIsAlwaysRootSpan =\n options.parentSpanIsAlwaysRootSpan === undefined ? true : options.parentSpanIsAlwaysRootSpan;\n\n // enableLogs must be disabled before calling super() to avoid logs being captured.\n // This makes a copy of the user defined value, so we can restore it later for the native usaege.\n const originalEnableLogs = options.enableLogs;\n if (options.enableLogs && options.logsOrigin === 'native') {\n debug.log('disabling Sentry logs on JavaScript due to rule set by logsOrigin');\n options.enableLogs = false;\n }\n\n super(options);\n\n this._outcomesBuffer = [];\n\n if (options.sendDefaultPii === true) {\n this.on('beforeSendSession', addAutoIpAddressToSession);\n }\n\n if (options.enableLogs) {\n this.on('flush', () => {\n _INTERNAL_flushLogsBuffer(this);\n });\n\n this.on('afterCaptureLog', () => {\n if (this._logFlushIdleTimeout) {\n clearTimeout(this._logFlushIdleTimeout);\n }\n\n this._logFlushIdleTimeout = setTimeout(() => {\n _INTERNAL_flushLogsBuffer(this);\n }, DEFAULT_FLUSH_INTERVAL);\n });\n }\n\n // Restore original settings for enabling Native options.\n options.enableLogs = originalEnableLogs;\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);\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);\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n * @deprecated Use `Sentry.captureFeedback` instead.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: undefined,\n });\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.sendEnvelope(envelope);\n }\n\n /**\n * @inheritdoc\n */\n public sendEnvelope(envelope: Envelope): PromiseLike<TransportMakeRequestResponse> {\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._isEnabled() && 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 debug.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n debug.error('Error while sending event:', reason);\n }\n });\n } else {\n debug.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n\n return Promise.resolve({});\n }\n\n /**\n * @inheritDoc\n */\n public init(): void {\n super.init();\n this._initNativeSdk();\n }\n\n /**\n * Register a hook on this client.\n *\n * (Generic method signature to allow for custom React Native Client events.)\n */\n public on(hook: string, callback: unknown): () => void {\n // @ts-expect-error on from the base class doesn't support generic types\n return super.on(hook, callback);\n }\n\n /**\n * Emit a hook that was previously registered via `on()`.\n *\n * (Generic method signature to allow for custom React Native Client events.)\n */\n public emit(hook: string, ...rest: unknown[]): void {\n // @ts-expect-error emit from the base class doesn't support generic types\n super.emit(hook, ...rest);\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk({\n ...this._options,\n defaultSidecarUrl: getDefaultSidecarUrl(),\n devServerUrl: getDevServer()?.url || '',\n mobileReplayOptions:\n this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] &&\n 'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME]\n ? (this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] as ReturnType<typeof mobileReplayIntegration>).options\n : undefined,\n })\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 this.emit('afterInit');\n })\n .then(undefined, error => {\n debug.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/ 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;AAYvE,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,MAAM,EACN,sBAAsB,EACtB,KAAK,EACL,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,YAAY,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,CAAC,CAAC;SACxC;IACH,CAAC;CACF","sourcesContent":["import { eventFromException, eventFromMessage } from '@sentry/browser';\nimport type {\n ClientReportEnvelope,\n ClientReportItem,\n Envelope,\n Event,\n EventHint,\n Outcome,\n SeverityLevel,\n TransportMakeRequestResponse,\n UserFeedback,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n addAutoIpAddressToSession,\n Client,\n dateTimestampInSeconds,\n debug,\n SentryError,\n} from '@sentry/core';\nimport { Alert } from 'react-native';\nimport { getDevServer } from './integrations/debugsymbolicatorutils';\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport { getDefaultSidecarUrl } from './integrations/spotlight';\nimport type { ReactNativeClientOptions } from './options';\nimport type { mobileReplayIntegration } from './replay/mobilereplay';\nimport { MOBILE_REPLAY_INTEGRATION_NAME } from './replay/mobilereplay';\nimport { createUserFeedbackEnvelope, items } from './utils/envelope';\nimport { ignoreRequireCycleLogs } from './utils/ignorerequirecyclelogs';\nimport { mergeOutcomes } from './utils/outcome';\nimport { ReactNativeLibraries } from './utils/rnlibraries';\nimport { NATIVE } from './wrapper';\n\nconst DEFAULT_FLUSH_INTERVAL = 5000;\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 Client<ReactNativeClientOptions> {\n private _outcomesBuffer: Outcome[];\n private _logFlushIdleTimeout: ReturnType<typeof setTimeout> | undefined;\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(ReactNativeLibraries.ReactNativeVersion?.version);\n options._metadata = {\n ...options._metadata,\n sdk: {\n ...(options._metadata?.sdk || defaultSdkInfo),\n settings: {\n // Only allow IP inferral by Relay if sendDefaultPii is true\n infer_ip: options.sendDefaultPii ? 'auto' : 'never',\n ...options._metadata?.sdk?.settings,\n },\n },\n };\n\n // We default this to true, as it is the safer scenario\n options.parentSpanIsAlwaysRootSpan =\n options.parentSpanIsAlwaysRootSpan === undefined ? true : options.parentSpanIsAlwaysRootSpan;\n\n // enableLogs must be disabled before calling super() to avoid logs being captured.\n // This makes a copy of the user defined value, so we can restore it later for the native usaege.\n const originalEnableLogs = options.enableLogs;\n if (options.enableLogs && options.logsOrigin === 'native') {\n debug.log('disabling Sentry logs on JavaScript due to rule set by logsOrigin');\n options.enableLogs = false;\n }\n\n super(options);\n\n this._outcomesBuffer = [];\n\n if (options.sendDefaultPii === true) {\n this.on('beforeSendSession', addAutoIpAddressToSession);\n }\n\n if (options.enableLogs) {\n this.on('flush', () => {\n _INTERNAL_flushLogsBuffer(this);\n });\n\n this.on('afterCaptureLog', () => {\n if (this._logFlushIdleTimeout) {\n clearTimeout(this._logFlushIdleTimeout);\n }\n\n this._logFlushIdleTimeout = setTimeout(() => {\n _INTERNAL_flushLogsBuffer(this);\n }, DEFAULT_FLUSH_INTERVAL);\n });\n }\n\n // Restore original settings for enabling Native options.\n options.enableLogs = originalEnableLogs;\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);\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);\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n * @deprecated Use `Sentry.captureFeedback` instead.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: undefined,\n });\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.sendEnvelope(envelope);\n }\n\n /**\n * @inheritdoc\n */\n public sendEnvelope(envelope: Envelope): PromiseLike<TransportMakeRequestResponse> {\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._isEnabled() && 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 debug.error('SentryError while sending event, keeping outcomes buffer:', reason);\n } else {\n debug.error('Error while sending event:', reason);\n }\n });\n } else {\n debug.error('Transport disabled');\n }\n\n if (shouldClearOutcomesBuffer) {\n this._outcomesBuffer = []; // if send fails synchronously the _outcomesBuffer will stay intact\n }\n\n return Promise.resolve({});\n }\n\n /**\n * @inheritDoc\n */\n public init(): void {\n super.init();\n this._initNativeSdk();\n }\n\n /**\n * Register a hook on this client.\n *\n * (Generic method signature to allow for custom React Native Client events.)\n */\n public on(hook: string, callback: unknown): () => void {\n // @ts-expect-error on from the base class doesn't support generic types\n return super.on(hook, callback);\n }\n\n /**\n * Emit a hook that was previously registered via `on()`.\n *\n * (Generic method signature to allow for custom React Native Client events.)\n */\n public emit(hook: string, ...rest: unknown[]): void {\n // @ts-expect-error emit from the base class doesn't support generic types\n super.emit(hook, ...rest);\n }\n\n /**\n * Starts native client with dsn and options\n */\n private _initNativeSdk(): void {\n NATIVE.initNativeSdk({\n ...this._options,\n defaultSidecarUrl: getDefaultSidecarUrl(),\n devServerUrl: getDevServer()?.url || '',\n mobileReplayOptions:\n this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] &&\n 'options' in this._integrations[MOBILE_REPLAY_INTEGRATION_NAME]\n ? (this._integrations[MOBILE_REPLAY_INTEGRATION_NAME] as ReturnType<typeof mobileReplayIntegration>).options\n : undefined,\n androidProfilingOptions: this._options._experiments?.androidProfilingOptions,\n })\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 this.emit('afterInit');\n })\n .then(undefined, error => {\n debug.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/ 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"]}
@@ -63,9 +63,10 @@ function walkErrorTree(parser, limit, error, key, exceptions = [], debugImages =
63
63
  exception = exceptionFromError(parser, error[key]);
64
64
  }
65
65
  else if (isPlainObject(linkedError)) {
66
+ const plainError = linkedError;
66
67
  exception = {
67
- type: typeof linkedError.name === 'string' ? linkedError.name : undefined,
68
- value: typeof linkedError.message === 'string' ? linkedError.message : undefined,
68
+ type: typeof plainError.name === 'string' ? plainError.name : undefined,
69
+ value: typeof plainError.message === 'string' ? plainError.message : undefined,
69
70
  };
70
71
  }
71
72
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"nativelinkederrors.js","sour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AAI,IAAI,YAAY,CAAC,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;aACtG,CAAA,CACJ;iBACA,OAAO,EAAE;SACb;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,sCAAsC,CAAC,aAI/C;IAIC,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAErF,OAAO;QACL,cAAc,EAAE;YACd,IAAI,EAAE,aAAa,CAAC,IAAI;YACxB,KAAK,EAAE,aAAa,CAAC,OAAO;YAC5B,UAAU,EAAE;gBACV,MAAM,EAAE,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,MAAM,CAAC,OAAO,EAAE,KAAI,EAAE;aAClD;SACF;QACD,gBAAgB,EAAE,CAAC,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,eAAgC,KAAI,EAAE;KAC7E,CAAC;AACJ,CAAC;AAED,IAAI,aAAa,GAAkB,IAAI,CAAC;AACxC;;GAEG;AACH,SAAS,kBAAkB;IACzB,IAAI,aAAa,KAAK,IAAI,EAAE;QAC1B,aAAa,GAAG,MAAM,CAAC,sBAAsB,EAAE,CAAC;KACjD;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,gBAA0B;IACxD,OAAO,MAAM,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import { exceptionFromError } from '@sentry/browser';\nimport type {\n Client,\n DebugImage,\n Event,\n EventHint,\n Exception,\n ExtendedError,\n Integration,\n StackFrame,\n StackParser,\n} from '@sentry/core';\nimport { isInstanceOf, isPlainObject, isString } from '@sentry/core';\nimport type { NativeStackFrames } from '../NativeRNSentry';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'NativeLinkedErrors';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\ninterface LinkedErrorsOptions {\n key: string;\n limit: number;\n}\n\n/**\n * Processes JS and RN native linked errors.\n */\nexport const nativeLinkedErrorsIntegration = (options: Partial<LinkedErrorsOptions> = {}): Integration => {\n const key = options.key || DEFAULT_KEY;\n const limit = options.limit || DEFAULT_LIMIT;\n\n return {\n name: INTEGRATION_NAME,\n setupOnce: (): void => {\n // noop\n },\n preprocessEvent: (event: Event, hint: EventHint, client: Client): void =>\n preprocessEvent(event, hint, client, limit, key),\n };\n};\n\nfunction preprocessEvent(event: Event, hint: EventHint | undefined, client: Client, limit: number, key: string): void {\n if (!event.exception?.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n const parser = client.getOptions().stackParser;\n\n const { exceptions: linkedErrors, debugImages } = walkErrorTree(\n parser,\n limit,\n hint.originalException as ExtendedError,\n key,\n );\n event.exception.values = [...event.exception.values, ...linkedErrors];\n\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n event.debug_meta.images.push(...(debugImages || []));\n}\n\n/**\n * Walks linked errors and created Sentry exceptions chain.\n * Collects debug images from native errors stack frames.\n */\nfunction walkErrorTree(\n parser: StackParser,\n limit: number,\n error: ExtendedError,\n key: string,\n exceptions: Exception[] = [],\n debugImages: DebugImage[] = [],\n): {\n exceptions: Exception[];\n debugImages?: DebugImage[];\n} {\n const linkedError = error[key];\n if (!linkedError || exceptions.length + 1 >= limit) {\n return {\n exceptions,\n debugImages,\n };\n }\n\n let exception: Exception;\n let exceptionDebugImages: DebugImage[] | undefined;\n if (isString(linkedError)) {\n exception = {\n value: linkedError,\n };\n } else if ('stackElements' in linkedError) {\n // isJavaException\n exception = exceptionFromJavaStackElements(linkedError);\n } else if ('stackReturnAddresses' in linkedError) {\n // isObjCException\n const { appleException, appleDebugImages } = exceptionFromAppleStackReturnAddresses(linkedError);\n exception = appleException;\n exceptionDebugImages = appleDebugImages;\n } else if (isInstanceOf(linkedError, Error)) {\n exception = exceptionFromError(parser, error[key]);\n } else if (isPlainObject(linkedError)) {\n exception = {\n type: typeof linkedError.name === 'string' ? linkedError.name : undefined,\n value: typeof linkedError.message === 'string' ? linkedError.message : undefined,\n };\n } else {\n return {\n exceptions,\n debugImages,\n };\n }\n\n return walkErrorTree(\n parser,\n limit,\n linkedError,\n key,\n [...exceptions, exception],\n [...debugImages, ...(exceptionDebugImages || [])],\n );\n}\n\n/**\n * Converts a Java Throwable to an SentryException\n */\nfunction exceptionFromJavaStackElements(javaThrowable: {\n name: string;\n message: string;\n stackElements: {\n className: string;\n fileName: string;\n methodName: string;\n lineNumber: number;\n }[];\n}): Exception {\n const nativePackage = fetchNativePackage();\n return {\n type: javaThrowable.name,\n value: javaThrowable.message,\n stacktrace: {\n frames: javaThrowable.stackElements\n .map(\n stackElement =>\n <StackFrame>{\n platform: 'java',\n module: stackElement.className,\n filename: stackElement.fileName,\n lineno: stackElement.lineNumber >= 0 ? stackElement.lineNumber : undefined,\n function: stackElement.methodName,\n in_app: nativePackage !== null && stackElement.className.startsWith(nativePackage) ? true : undefined,\n },\n )\n .reverse(),\n },\n };\n}\n\n/**\n * Converts StackAddresses to a SentryException with DebugMetaImages\n */\nfunction exceptionFromAppleStackReturnAddresses(objCException: {\n name: string;\n message: string;\n stackReturnAddresses: number[];\n}): {\n appleException: Exception;\n appleDebugImages: DebugImage[];\n} {\n const nativeStackFrames = fetchNativeStackFrames(objCException.stackReturnAddresses);\n\n return {\n appleException: {\n type: objCException.name,\n value: objCException.message,\n stacktrace: {\n frames: nativeStackFrames?.frames.reverse() || [],\n },\n },\n appleDebugImages: (nativeStackFrames?.debugMetaImages as DebugImage[]) || [],\n };\n}\n\nlet nativePackage: string | null = null;\n/**\n * Fetches the native package/image name from the native layer\n */\nfunction fetchNativePackage(): string | null {\n if (nativePackage === null) {\n nativePackage = NATIVE.fetchNativePackageName();\n }\n return nativePackage;\n}\n\n/**\n * Fetches native debug image information on iOS\n */\nfunction fetchNativeStackFrames(instructionsAddr: number[]): NativeStackFrames | null {\n return NATIVE.fetchNativeStackFramesBy(instructionsAddr);\n}\n"]}
1
+ {"version":3,"file":"nativelinkederrors.js","sourceRoot":"","sources":["../../../src/js/integrations/nativelinkederrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAYrD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAE9C,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,aAAa,GAAG,CAAC,CAAC;AAOxB;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,UAAwC,EAAE,EAAe,EAAE;IACvG,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,WAAW,CAAC;IACvC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,aAAa,CAAC;IAE7C,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAS,EAAE;YACpB,OAAO;QACT,CAAC;QACD,eAAe,EAAE,CAAC,KAAY,EAAE,IAAe,EAAE,MAAc,EAAQ,EAAE,CACvE,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC;KACnD,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,eAAe,CAAC,KAAY,EAAE,IAA2B,EAAE,MAAc,EAAE,KAAa,EAAE,GAAW;;IAC5G,IAAI,CAAC,CAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,CAAA,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,EAAE;QACrF,OAAO;KACR;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU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YAAY,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;gBAC1E,QAAQ,EAAE,YAAY,CAAC,UAAU;gBACjC,MAAM,EAAE,aAAa,KAAK,IAAI,IAAI,YAAY,CAAC,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;aACtG,CAAA,CACJ;iBACA,OAAO,EAAE;SACb;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,sCAAsC,CAAC,aAI/C;IAIC,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAErF,OAAO;QACL,cAAc,EAAE;YACd,IAAI,EAAE,aAAa,CAAC,IAAI;YACxB,KAAK,EAAE,aAAa,CAAC,OAAO;YAC5B,UAAU,EAAE;gBACV,MAAM,EAAE,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,MAAM,CAAC,OAAO,EAAE,KAAI,EAAE;aAClD;SACF;QACD,gBAAgB,EAAE,CAAC,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,eAAgC,KAAI,EAAE;KAC7E,CAAC;AACJ,CAAC;AAED,IAAI,aAAa,GAAkB,IAAI,CAAC;AACxC;;GAEG;AACH,SAAS,kBAAkB;IACzB,IAAI,aAAa,KAAK,IAAI,EAAE;QAC1B,aAAa,GAAG,MAAM,CAAC,sBAAsB,EAAE,CAAC;KACjD;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,gBAA0B;IACxD,OAAO,MAAM,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import { exceptionFromError } from '@sentry/browser';\nimport type {\n Client,\n DebugImage,\n Event,\n EventHint,\n Exception,\n ExtendedError,\n Integration,\n StackFrame,\n StackParser,\n} from '@sentry/core';\nimport { isInstanceOf, isPlainObject, isString } from '@sentry/core';\nimport type { NativeStackFrames } from '../NativeRNSentry';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'NativeLinkedErrors';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\ninterface LinkedErrorsOptions {\n key: string;\n limit: number;\n}\n\n/**\n * Processes JS and RN native linked errors.\n */\nexport const nativeLinkedErrorsIntegration = (options: Partial<LinkedErrorsOptions> = {}): Integration => {\n const key = options.key || DEFAULT_KEY;\n const limit = options.limit || DEFAULT_LIMIT;\n\n return {\n name: INTEGRATION_NAME,\n setupOnce: (): void => {\n // noop\n },\n preprocessEvent: (event: Event, hint: EventHint, client: Client): void =>\n preprocessEvent(event, hint, client, limit, key),\n };\n};\n\nfunction preprocessEvent(event: Event, hint: EventHint | undefined, client: Client, limit: number, key: string): void {\n if (!event.exception?.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n const parser = client.getOptions().stackParser;\n\n const { exceptions: linkedErrors, debugImages } = walkErrorTree(\n parser,\n limit,\n hint.originalException as ExtendedError,\n key,\n );\n event.exception.values = [...event.exception.values, ...linkedErrors];\n\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n event.debug_meta.images.push(...(debugImages || []));\n}\n\n/**\n * Walks linked errors and created Sentry exceptions chain.\n * Collects debug images from native errors stack frames.\n */\nfunction walkErrorTree(\n parser: StackParser,\n limit: number,\n error: ExtendedError,\n key: string,\n exceptions: Exception[] = [],\n debugImages: DebugImage[] = [],\n): {\n exceptions: Exception[];\n debugImages?: DebugImage[];\n} {\n const linkedError = error[key];\n if (!linkedError || exceptions.length + 1 >= limit) {\n return {\n exceptions,\n debugImages,\n };\n }\n\n let exception: Exception;\n let exceptionDebugImages: DebugImage[] | undefined;\n if (isString(linkedError)) {\n exception = {\n value: linkedError,\n };\n } else if ('stackElements' in linkedError) {\n // isJavaException\n exception = exceptionFromJavaStackElements(linkedError);\n } else if ('stackReturnAddresses' in linkedError) {\n // isObjCException\n const { appleException, appleDebugImages } = exceptionFromAppleStackReturnAddresses(linkedError);\n exception = appleException;\n exceptionDebugImages = appleDebugImages;\n } else if (isInstanceOf(linkedError, Error)) {\n exception = exceptionFromError(parser, error[key]);\n } else if (isPlainObject(linkedError)) {\n const plainError = linkedError as Record<string, unknown>;\n exception = {\n type: typeof plainError.name === 'string' ? plainError.name : undefined,\n value: typeof plainError.message === 'string' ? plainError.message : undefined,\n };\n } else {\n return {\n exceptions,\n debugImages,\n };\n }\n\n return walkErrorTree(\n parser,\n limit,\n linkedError,\n key,\n [...exceptions, exception],\n [...debugImages, ...(exceptionDebugImages || [])],\n );\n}\n\n/**\n * Converts a Java Throwable to an SentryException\n */\nfunction exceptionFromJavaStackElements(javaThrowable: {\n name: string;\n message: string;\n stackElements: {\n className: string;\n fileName: string;\n methodName: string;\n lineNumber: number;\n }[];\n}): Exception {\n const nativePackage = fetchNativePackage();\n return {\n type: javaThrowable.name,\n value: javaThrowable.message,\n stacktrace: {\n frames: javaThrowable.stackElements\n .map(\n stackElement =>\n <StackFrame>{\n platform: 'java',\n module: stackElement.className,\n filename: stackElement.fileName,\n lineno: stackElement.lineNumber >= 0 ? stackElement.lineNumber : undefined,\n function: stackElement.methodName,\n in_app: nativePackage !== null && stackElement.className.startsWith(nativePackage) ? true : undefined,\n },\n )\n .reverse(),\n },\n };\n}\n\n/**\n * Converts StackAddresses to a SentryException with DebugMetaImages\n */\nfunction exceptionFromAppleStackReturnAddresses(objCException: {\n name: string;\n message: string;\n stackReturnAddresses: number[];\n}): {\n appleException: Exception;\n appleDebugImages: DebugImage[];\n} {\n const nativeStackFrames = fetchNativeStackFrames(objCException.stackReturnAddresses);\n\n return {\n appleException: {\n type: objCException.name,\n value: objCException.message,\n stacktrace: {\n frames: nativeStackFrames?.frames.reverse() || [],\n },\n },\n appleDebugImages: (nativeStackFrames?.debugMetaImages as DebugImage[]) || [],\n };\n}\n\nlet nativePackage: string | null = null;\n/**\n * Fetches the native package/image name from the native layer\n */\nfunction fetchNativePackage(): string | null {\n if (nativePackage === null) {\n nativePackage = NATIVE.fetchNativePackageName();\n }\n return nativePackage;\n}\n\n/**\n * Fetches native debug image information on iOS\n */\nfunction fetchNativeStackFrames(instructionsAddr: number[]): NativeStackFrames | null {\n return NATIVE.fetchNativeStackFramesBy(instructionsAddr);\n}\n"]}
@@ -244,7 +244,7 @@ export interface BaseReactNativeOptions {
244
244
  /**
245
245
  * Experiment: A more reliable way to report unhandled C++ exceptions in iOS.
246
246
  *
247
- * This approach hooks into all instances of the `__cxa_throw` function, which provides a more comprehensive and consistent exception handling across an apps runtime, regardless of the number of C++ modules or how theyre linked. It helps in obtaining accurate stack traces.
247
+ * This approach hooks into all instances of the `__cxa_throw` function, which provides a more comprehensive and consistent exception handling across an app's runtime, regardless of the number of C++ modules or how they're linked. It helps in obtaining accurate stack traces.
248
248
  *
249
249
  * - Note: The mechanism of hooking into `__cxa_throw` could cause issues with symbolication on iOS due to caching of symbol references.
250
250
  *
@@ -252,6 +252,16 @@ export interface BaseReactNativeOptions {
252
252
  * @platform ios
253
253
  */
254
254
  enableUnhandledCPPExceptionsV2?: boolean;
255
+ /**
256
+ * Configuration options for Android UI profiling.
257
+ * UI profiling supports two modes: `manual` and `trace`.
258
+ * - In `trace` mode, the profiler runs based on active sampled spans.
259
+ * - In `manual` mode, profiling is controlled via start/stop API calls.
260
+ *
261
+ * @experimental
262
+ * @platform android
263
+ */
264
+ androidProfilingOptions?: AndroidProfilingOptions;
255
265
  };
256
266
  /**
257
267
  * This options changes the placement of the attached stacktrace of `captureMessage` in the event.
@@ -284,6 +294,44 @@ export interface BaseReactNativeOptions {
284
294
  logsOrigin?: 'all' | 'js' | 'native';
285
295
  }
286
296
  export type SentryReplayQuality = 'low' | 'medium' | 'high';
297
+ /**
298
+ * Android UI profiling lifecycle modes.
299
+ * - `trace`: Profiler runs based on active sampled spans
300
+ * - `manual`: Profiler is controlled manually via start/stop API calls
301
+ */
302
+ export type AndroidProfilingLifecycle = 'trace' | 'manual';
303
+ /**
304
+ * Configuration options for Android UI profiling.
305
+ *
306
+ * @experimental
307
+ * @platform android
308
+ */
309
+ export interface AndroidProfilingOptions {
310
+ /**
311
+ * Sample rate for profiling sessions.
312
+ * This is evaluated once per session and determines if profiling should be enabled for that session.
313
+ * 1.0 will enable profiling for all sessions, 0.0 will disable profiling.
314
+ *
315
+ * @default undefined (profiling disabled)
316
+ */
317
+ profileSessionSampleRate?: number;
318
+ /**
319
+ * Profiling lifecycle mode.
320
+ * - `trace`: Profiler runs while there is at least one active sampled span
321
+ * - `manual`: Profiler is controlled manually via Sentry.profiler.startProfiler/stopProfiler
322
+ *
323
+ * @default 'trace'
324
+ */
325
+ lifecycle?: AndroidProfilingLifecycle;
326
+ /**
327
+ * Enable profiling on app start.
328
+ * - In `trace` mode: The app start profile stops automatically when the app start root span finishes
329
+ * - In `manual` mode: The app start profile must be stopped through Sentry.profiler.stopProfiler()
330
+ *
331
+ * @default false
332
+ */
333
+ startOnAppStart?: boolean;
334
+ }
287
335
  export interface ReactNativeTransportOptions extends BrowserTransportOptions {
288
336
  /**
289
337
  * @deprecated use `maxQueueSize` in the root of the SDK options.
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAG7D,KAAK,aAAa,GAAG,KAAK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CAAC;IAEzE,8CAA8C;IAC9C,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CACnD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAiBtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAkW/C;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAoB;IAC3D,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;QACpC,yCAAyC;QACzC,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,IAAI,QAAQ,EAAE,EAAE;QACd,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { makeFetchTransport } from '@sentry/browser';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/core';\nimport type { BrowserOptions, Profiler } from '@sentry/react';\nimport type * as React from 'react';\nimport { Platform } from 'react-native';\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { isExpoGo } from './utils/environment';\n\ntype ProfilerProps = React.ComponentProps<typeof Profiler>;\ntype BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];\n\ntype BrowserExperiments = NonNullable<BrowserOptions['_experiments']>;\ntype SharedExperimentsSubset = BrowserExperiments;\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable NDK on Android\n *\n * @default true\n * @platform android\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n *\n * @platform android\n */\n enableNdkScopeSync?: boolean;\n\n /**\n * When enabled, all the threads are automatically attached to all logged events on Android\n *\n * @platform android\n */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n * @platform ios\n */\n enableWatchdogTerminationTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n * @platform ios\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n * @platform ios\n */\n appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n\n /**\n * Sets a callback which is executed before capturing screenshots. Only\n * relevant if `attachScreenshot` is set to true. When false is returned\n * from the function, no screenshot will be attached.\n */\n beforeScreenshot?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * Track the app start time by adding measurements to the first route transaction. If there is no routing instrumentation\n * an app start transaction will be started.\n *\n * Requires performance monitoring to be enabled.\n *\n * @default true\n */\n enableAppStartTracking?: boolean;\n\n /**\n * Track the slow and frozen frames in the application. Enabling this options will add\n * slow and frozen frames measurements to all created root spans (transactions).\n *\n * @default true\n */\n enableNativeFramesTracking?: boolean;\n\n /**\n * Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.\n *\n * @default true\n */\n enableStallTracking?: boolean;\n\n /**\n * Trace User Interaction events like touch and gestures.\n *\n * @default false\n */\n enableUserInteractionTracing?: boolean;\n\n /**\n * The sample rate for profiling\n * 1.0 will profile all transactions and 0 will profile none.\n */\n profilesSampleRate?: number;\n\n /**\n * The sample rate for session-long replays.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * The sample rate for sessions that has had an error occur.\n * This is independent of `sessionSampleRate`.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause\n * problems for sending events from command line applications. Setting it too\n * high can cause the application to block for users with network connectivity\n * problems.\n */\n shutdownTimeout?: number;\n\n /**\n * Defines the quality of the session replay. The higher the quality, the more accurate the replay\n * will be, but also more data to transfer and more CPU load.\n *\n * @default 'medium'\n */\n replaysSessionQuality?: SentryReplayQuality;\n\n /**\n * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: SharedExperimentsSubset & {\n [key: string]: unknown;\n\n /**\n * @deprecated Use `replaysSessionSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * @deprecated Use `replaysOnErrorSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Experiment: A more reliable way to report unhandled C++ exceptions in iOS.\n *\n * This approach hooks into all instances of the `__cxa_throw` function, which provides a more comprehensive and consistent exception handling across an app’s runtime, regardless of the number of C++ modules or how they’re linked. It helps in obtaining accurate stack traces.\n *\n * - Note: The mechanism of hooking into `__cxa_throw` could cause issues with symbolication on iOS due to caching of symbol references.\n *\n * @default false\n * @platform ios\n */\n enableUnhandledCPPExceptionsV2?: boolean;\n };\n\n /**\n * This options changes the placement of the attached stacktrace of `captureMessage` in the event.\n *\n * @default false\n * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.\n */\n useThreadsForMessageStack?: boolean;\n\n /**\n * If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,\n * in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}\n * option to control to which outgoing requests the header will be attached.\n *\n * **Important:** If you set this option to `true`, make sure that you configured your servers'\n * CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.\n *\n * @see https://www.w3.org/TR/trace-context/\n *\n * @default false\n */\n propagateTraceparent?: boolean;\n\n /**\n * Controls which log origin is captured when `enableLogs` is set to true.\n * 'all' will log all origins.\n * 'js' will capture only JavaScript logs.\n * 'native' will capture only native logs.\n *\n * @default 'all'\n */\n logsOrigin?: 'all' | 'js' | 'native';\n}\n\nexport type SentryReplayQuality = 'low' | 'medium' | 'high';\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: Omit<ProfilerProps, 'updateProps' | 'children' | 'name'>;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n if (isExpoGo()) {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAuZ/C;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAoB;IAC3D,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;QACpC,yCAAyC;QACzC,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,IAAI,QAAQ,EAAE,EAAE;QACd,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { makeFetchTransport } from '@sentry/browser';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/core';\nimport type { BrowserOptions, Profiler } from '@sentry/react';\nimport type * as React from 'react';\nimport { Platform } from 'react-native';\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { isExpoGo } from './utils/environment';\n\ntype ProfilerProps = React.ComponentProps<typeof Profiler>;\ntype BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];\n\ntype BrowserExperiments = NonNullable<BrowserOptions['_experiments']>;\ntype SharedExperimentsSubset = BrowserExperiments;\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable NDK on Android\n *\n * @default true\n * @platform android\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n *\n * @platform android\n */\n enableNdkScopeSync?: boolean;\n\n /**\n * When enabled, all the threads are automatically attached to all logged events on Android\n *\n * @platform android\n */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n * @platform ios\n */\n enableWatchdogTerminationTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n * @platform ios\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n * @platform ios\n */\n appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n\n /**\n * Sets a callback which is executed before capturing screenshots. Only\n * relevant if `attachScreenshot` is set to true. When false is returned\n * from the function, no screenshot will be attached.\n */\n beforeScreenshot?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * Track the app start time by adding measurements to the first route transaction. If there is no routing instrumentation\n * an app start transaction will be started.\n *\n * Requires performance monitoring to be enabled.\n *\n * @default true\n */\n enableAppStartTracking?: boolean;\n\n /**\n * Track the slow and frozen frames in the application. Enabling this options will add\n * slow and frozen frames measurements to all created root spans (transactions).\n *\n * @default true\n */\n enableNativeFramesTracking?: boolean;\n\n /**\n * Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.\n *\n * @default true\n */\n enableStallTracking?: boolean;\n\n /**\n * Trace User Interaction events like touch and gestures.\n *\n * @default false\n */\n enableUserInteractionTracing?: boolean;\n\n /**\n * The sample rate for profiling\n * 1.0 will profile all transactions and 0 will profile none.\n */\n profilesSampleRate?: number;\n\n /**\n * The sample rate for session-long replays.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * The sample rate for sessions that has had an error occur.\n * This is independent of `sessionSampleRate`.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause\n * problems for sending events from command line applications. Setting it too\n * high can cause the application to block for users with network connectivity\n * problems.\n */\n shutdownTimeout?: number;\n\n /**\n * Defines the quality of the session replay. The higher the quality, the more accurate the replay\n * will be, but also more data to transfer and more CPU load.\n *\n * @default 'medium'\n */\n replaysSessionQuality?: SentryReplayQuality;\n\n /**\n * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: SharedExperimentsSubset & {\n [key: string]: unknown;\n\n /**\n * @deprecated Use `replaysSessionSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * @deprecated Use `replaysOnErrorSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Experiment: A more reliable way to report unhandled C++ exceptions in iOS.\n *\n * This approach hooks into all instances of the `__cxa_throw` function, which provides a more comprehensive and consistent exception handling across an app's runtime, regardless of the number of C++ modules or how they're linked. It helps in obtaining accurate stack traces.\n *\n * - Note: The mechanism of hooking into `__cxa_throw` could cause issues with symbolication on iOS due to caching of symbol references.\n *\n * @default false\n * @platform ios\n */\n enableUnhandledCPPExceptionsV2?: boolean;\n\n /**\n * Configuration options for Android UI profiling.\n * UI profiling supports two modes: `manual` and `trace`.\n * - In `trace` mode, the profiler runs based on active sampled spans.\n * - In `manual` mode, profiling is controlled via start/stop API calls.\n *\n * @experimental\n * @platform android\n */\n androidProfilingOptions?: AndroidProfilingOptions;\n };\n\n /**\n * This options changes the placement of the attached stacktrace of `captureMessage` in the event.\n *\n * @default false\n * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.\n */\n useThreadsForMessageStack?: boolean;\n\n /**\n * If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,\n * in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}\n * option to control to which outgoing requests the header will be attached.\n *\n * **Important:** If you set this option to `true`, make sure that you configured your servers'\n * CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.\n *\n * @see https://www.w3.org/TR/trace-context/\n *\n * @default false\n */\n propagateTraceparent?: boolean;\n\n /**\n * Controls which log origin is captured when `enableLogs` is set to true.\n * 'all' will log all origins.\n * 'js' will capture only JavaScript logs.\n * 'native' will capture only native logs.\n *\n * @default 'all'\n */\n logsOrigin?: 'all' | 'js' | 'native';\n}\n\nexport type SentryReplayQuality = 'low' | 'medium' | 'high';\n\n/**\n * Android UI profiling lifecycle modes.\n * - `trace`: Profiler runs based on active sampled spans\n * - `manual`: Profiler is controlled manually via start/stop API calls\n */\nexport type AndroidProfilingLifecycle = 'trace' | 'manual';\n\n/**\n * Configuration options for Android UI profiling.\n *\n * @experimental\n * @platform android\n */\nexport interface AndroidProfilingOptions {\n /**\n * Sample rate for profiling sessions.\n * This is evaluated once per session and determines if profiling should be enabled for that session.\n * 1.0 will enable profiling for all sessions, 0.0 will disable profiling.\n *\n * @default undefined (profiling disabled)\n */\n profileSessionSampleRate?: number;\n\n /**\n * Profiling lifecycle mode.\n * - `trace`: Profiler runs while there is at least one active sampled span\n * - `manual`: Profiler is controlled manually via Sentry.profiler.startProfiler/stopProfiler\n *\n * @default 'trace'\n */\n lifecycle?: AndroidProfilingLifecycle;\n\n /**\n * Enable profiling on app start.\n * - In `trace` mode: The app start profile stops automatically when the app start root span finishes\n * - In `manual` mode: The app start profile must be stopped through Sentry.profiler.stopProfiler()\n *\n * @default false\n */\n startOnAppStart?: boolean;\n}\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: Omit<ProfilerProps, 'updateProps' | 'children' | 'name'>;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n if (isExpoGo()) {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
@@ -66,6 +66,32 @@ export interface MobileReplayOptions {
66
66
  * @platform ios
67
67
  */
68
68
  enableFastViewRendering?: boolean;
69
+ /**
70
+ * Array of view class names to include in subtree traversal during session replay and screenshot capture on iOS.
71
+ *
72
+ * Only views that are instances of these classes (or subclasses) will be traversed.
73
+ * This helps prevent crashes when traversing problematic view hierarchies by allowing you to explicitly include only safe view classes.
74
+ *
75
+ * If both `includedViewClasses` and `excludedViewClasses` are set, `excludedViewClasses` takes precedence:
76
+ * views matching excluded classes won't be traversed even if they match an included class.
77
+ *
78
+ * @default undefined
79
+ * @platform ios
80
+ */
81
+ includedViewClasses?: string[];
82
+ /**
83
+ * Array of view class names to exclude from subtree traversal during session replay and screenshot capture on iOS.
84
+ *
85
+ * Views of these classes (or subclasses) will be skipped entirely, including all their children.
86
+ * This helps prevent crashes when traversing problematic view hierarchies by allowing you to explicitly exclude problematic view classes.
87
+ *
88
+ * If both `includedViewClasses` and `excludedViewClasses` are set, `excludedViewClasses` takes precedence:
89
+ * views matching excluded classes won't be traversed even if they match an included class.
90
+ *
91
+ * @default undefined
92
+ * @platform ios
93
+ */
94
+ excludedViewClasses?: string[];
69
95
  /**
70
96
  * Sets the screenshot strategy used by the Session Replay integration on Android.
71
97
  *
@@ -1 +1 @@
1
- {"version":3,"file":"mobilereplay.d.ts","sourceRoot":"","sources":["../../../src/js/replay/mobilereplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,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WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;;OAUG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IAEzC;;;;;;;;;;;;OAYG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;;;;;;;;;;OAWG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;;;;;;;OAQG;IACH,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC;CAClE;AAyBD,KAAK,uBAAuB,GAAG,WAAW,GAAG;IAC3C,OAAO,EAAE,mBAAmB,CAAC;IAC7B,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,iBAAiB,mBAAmB,KAAoB,uBA4I3F,CAAC"}
@@ -98,6 +98,9 @@ export const mobileReplayIntegration = (initOptions = defaultOptions) => {
98
98
  if (replayId) {
99
99
  updateCachedReplayId(replayId);
100
100
  debug.log(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} Captured recording replay ${replayId} for event ${event.event_id}.`);
101
+ // Add replay_id to error event contexts to link replays to events/traces
102
+ event.contexts = event.contexts || {};
103
+ event.contexts.replay = Object.assign(Object.assign({}, event.contexts.replay), { replay_id: replayId });
101
104
  }
102
105
  else {
103
106
  // Check if there's an ongoing recording and update cache if found
@@ -105,6 +108,9 @@ export const mobileReplayIntegration = (initOptions = defaultOptions) => {
105
108
  if (recordingReplayId) {
106
109
  updateCachedReplayId(recordingReplayId);
107
110
  debug.log(`[Sentry] ${MOBILE_REPLAY_INTEGRATION_NAME} assign already recording replay ${recordingReplayId} for event ${event.event_id}.`);
111
+ // Add replay_id to error event contexts to link replays to events/traces
112
+ event.contexts = event.contexts || {};
113
+ event.contexts.replay = Object.assign(Object.assign({}, event.contexts.replay), { replay_id: recordingReplayId });
108
114
  }
109
115
  else {
110
116
  updateCachedReplayId(null);
@@ -130,6 +136,14 @@ export const mobileReplayIntegration = (initOptions = defaultOptions) => {
130
136
  dsc.replay_id = currentReplayId;
131
137
  }
132
138
  });
139
+ client.on('processMetric', (metric) => {
140
+ // Add replay_id to metric attributes to link metrics to replays
141
+ const currentReplayId = getCachedReplayId();
142
+ if (currentReplayId) {
143
+ metric.attributes = metric.attributes || {};
144
+ metric.attributes.replay_id = currentReplayId;
145
+ }
146
+ });
133
147
  client.on('beforeAddBreadcrumb', enrichXhrBreadcrumbsForMobileReplay);
134
148
  }
135
149
  function getReplayId() {