@sentry/react-native 7.0.0-beta.2 → 7.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/RNSentry.podspec +1 -1
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +77 -0
  4. package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
  5. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +5 -0
  6. package/dist/js/NativeRNSentry.d.ts +1 -0
  7. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  8. package/dist/js/NativeRNSentry.js.map +1 -1
  9. package/dist/js/client.d.ts +2 -2
  10. package/dist/js/client.d.ts.map +1 -1
  11. package/dist/js/client.js +6 -6
  12. package/dist/js/client.js.map +1 -1
  13. package/dist/js/feedback/FeedbackWidget.js +12 -12
  14. package/dist/js/feedback/FeedbackWidget.js.map +1 -1
  15. package/dist/js/feedback/FeedbackWidgetManager.js +2 -2
  16. package/dist/js/feedback/FeedbackWidgetManager.js.map +1 -1
  17. package/dist/js/feedback/FeedbackWidgetProvider.js +3 -3
  18. package/dist/js/feedback/FeedbackWidgetProvider.js.map +1 -1
  19. package/dist/js/index.d.ts +1 -1
  20. package/dist/js/index.d.ts.map +1 -1
  21. package/dist/js/index.js +1 -1
  22. package/dist/js/index.js.map +1 -1
  23. package/dist/js/integrations/appRegistry.js +2 -2
  24. package/dist/js/integrations/appRegistry.js.map +1 -1
  25. package/dist/js/integrations/debugsymbolicator.js +3 -3
  26. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  27. package/dist/js/integrations/debugsymbolicatorutils.js +3 -3
  28. package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
  29. package/dist/js/integrations/default.d.ts.map +1 -1
  30. package/dist/js/integrations/default.js +7 -4
  31. package/dist/js/integrations/default.js.map +1 -1
  32. package/dist/js/integrations/devicecontext.js +2 -2
  33. package/dist/js/integrations/devicecontext.js.map +1 -1
  34. package/dist/js/integrations/expocontext.d.ts.map +1 -1
  35. package/dist/js/integrations/expocontext.js +2 -2
  36. package/dist/js/integrations/expocontext.js.map +1 -1
  37. package/dist/js/integrations/exports.d.ts +1 -0
  38. package/dist/js/integrations/exports.d.ts.map +1 -1
  39. package/dist/js/integrations/exports.js +1 -0
  40. package/dist/js/integrations/exports.js.map +1 -1
  41. package/dist/js/integrations/logEnricherIntegration.d.ts +3 -0
  42. package/dist/js/integrations/logEnricherIntegration.d.ts.map +1 -0
  43. package/dist/js/integrations/logEnricherIntegration.js +65 -0
  44. package/dist/js/integrations/logEnricherIntegration.js.map +1 -0
  45. package/dist/js/integrations/modulesloader.js +2 -2
  46. package/dist/js/integrations/modulesloader.js.map +1 -1
  47. package/dist/js/integrations/reactnativeerrorhandlers.js +12 -12
  48. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  49. package/dist/js/integrations/reactnativeerrorhandlersutils.js +6 -6
  50. package/dist/js/integrations/reactnativeerrorhandlersutils.js.map +1 -1
  51. package/dist/js/integrations/sdkinfo.js +3 -3
  52. package/dist/js/integrations/sdkinfo.js.map +1 -1
  53. package/dist/js/integrations/spotlight.js +4 -4
  54. package/dist/js/integrations/spotlight.js.map +1 -1
  55. package/dist/js/integrations/viewhierarchy.js +2 -2
  56. package/dist/js/integrations/viewhierarchy.js.map +1 -1
  57. package/dist/js/options.d.ts +8 -0
  58. package/dist/js/options.d.ts.map +1 -1
  59. package/dist/js/options.js.map +1 -1
  60. package/dist/js/playground/modal.js +3 -3
  61. package/dist/js/playground/modal.js.map +1 -1
  62. package/dist/js/profiling/convertHermesProfile.js +5 -5
  63. package/dist/js/profiling/convertHermesProfile.js.map +1 -1
  64. package/dist/js/profiling/debugid.d.ts.map +1 -1
  65. package/dist/js/profiling/debugid.js +2 -2
  66. package/dist/js/profiling/debugid.js.map +1 -1
  67. package/dist/js/profiling/integration.js +13 -13
  68. package/dist/js/profiling/integration.js.map +1 -1
  69. package/dist/js/profiling/utils.js +3 -3
  70. package/dist/js/profiling/utils.js.map +1 -1
  71. package/dist/js/replay/CustomMask.js +3 -3
  72. package/dist/js/replay/CustomMask.js.map +1 -1
  73. package/dist/js/replay/mobilereplay.js +5 -5
  74. package/dist/js/replay/mobilereplay.js.map +1 -1
  75. package/dist/js/sdk.js +7 -7
  76. package/dist/js/sdk.js.map +1 -1
  77. package/dist/js/tools/ModulesCollector.js +12 -12
  78. package/dist/js/tools/ModulesCollector.js.map +1 -1
  79. package/dist/js/tools/enableLogger.js +1 -1
  80. package/dist/js/tools/enableLogger.js.map +1 -1
  81. package/dist/js/tools/metroMiddleware.js +6 -6
  82. package/dist/js/tools/metroMiddleware.js.map +1 -1
  83. package/dist/js/tools/metroconfig.js +2 -2
  84. package/dist/js/tools/metroconfig.js.map +1 -1
  85. package/dist/js/tools/sentryBabelTransformerUtils.d.ts.map +1 -1
  86. package/dist/js/tools/sentryBabelTransformerUtils.js +6 -6
  87. package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -1
  88. package/dist/js/touchevents.js +3 -3
  89. package/dist/js/touchevents.js.map +1 -1
  90. package/dist/js/tracing/gesturetracing.js +5 -5
  91. package/dist/js/tracing/gesturetracing.js.map +1 -1
  92. package/dist/js/tracing/integrations/appStart.js +34 -34
  93. package/dist/js/tracing/integrations/appStart.js.map +1 -1
  94. package/dist/js/tracing/integrations/nativeFrames.js +14 -14
  95. package/dist/js/tracing/integrations/nativeFrames.js.map +1 -1
  96. package/dist/js/tracing/integrations/stalltracking.js +7 -7
  97. package/dist/js/tracing/integrations/stalltracking.js.map +1 -1
  98. package/dist/js/tracing/integrations/timeToDisplayIntegration.js +11 -11
  99. package/dist/js/tracing/integrations/timeToDisplayIntegration.js.map +1 -1
  100. package/dist/js/tracing/integrations/userInteraction.js +8 -8
  101. package/dist/js/tracing/integrations/userInteraction.js.map +1 -1
  102. package/dist/js/tracing/onSpanEndUtils.js +10 -10
  103. package/dist/js/tracing/onSpanEndUtils.js.map +1 -1
  104. package/dist/js/tracing/reactnativeprofiler.js +2 -2
  105. package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
  106. package/dist/js/tracing/reactnavigation.js +14 -14
  107. package/dist/js/tracing/reactnavigation.js.map +1 -1
  108. package/dist/js/tracing/span.d.ts.map +1 -1
  109. package/dist/js/tracing/span.js +11 -5
  110. package/dist/js/tracing/span.js.map +1 -1
  111. package/dist/js/tracing/timetodisplay.js +20 -20
  112. package/dist/js/tracing/timetodisplay.js.map +1 -1
  113. package/dist/js/tracing/utils.js +2 -2
  114. package/dist/js/tracing/utils.js.map +1 -1
  115. package/dist/js/utils/safe.js +3 -3
  116. package/dist/js/utils/safe.js.map +1 -1
  117. package/dist/js/version.d.ts +1 -1
  118. package/dist/js/version.d.ts.map +1 -1
  119. package/dist/js/version.js +1 -1
  120. package/dist/js/version.js.map +1 -1
  121. package/dist/js/wrapper.d.ts +1 -0
  122. package/dist/js/wrapper.d.ts.map +1 -1
  123. package/dist/js/wrapper.js +40 -26
  124. package/dist/js/wrapper.js.map +1 -1
  125. package/ios/RNSentry.h +7 -1
  126. package/ios/RNSentry.mm +86 -21
  127. package/ios/RNSentryReplay.mm +4 -0
  128. package/ios/RNSentryReplayBreadcrumbConverter.h +1 -1
  129. package/ios/RNSentryReplayBreadcrumbConverter.m +17 -4
  130. package/ios/RNSentryReplayQuality.h +13 -0
  131. package/ios/RNSentryReplayQuality.m +25 -0
  132. package/ios/RNSentryVersion.m +1 -1
  133. package/ios/SentrySDKWrapper.h +18 -0
  134. package/ios/SentrySDKWrapper.m +31 -0
  135. package/package.json +11 -11
  136. package/scripts/expo-upload-sourcemaps.js +4 -1
  137. package/scripts/sentry-xcode-debug-files.sh +25 -2
  138. package/scripts/sentry-xcode.sh +23 -3
  139. package/sentry.gradle +27 -6
  140. package/src/js/NativeRNSentry.ts +1 -0
  141. package/ts3.8/dist/js/NativeRNSentry.d.ts +1 -0
  142. package/ts3.8/dist/js/client.d.ts +2 -2
  143. package/ts3.8/dist/js/index.d.ts +1 -1
  144. package/ts3.8/dist/js/integrations/exports.d.ts +1 -0
  145. package/ts3.8/dist/js/integrations/logEnricherIntegration.d.ts +3 -0
  146. package/ts3.8/dist/js/options.d.ts +8 -0
  147. package/ts3.8/dist/js/version.d.ts +1 -1
  148. package/ts3.8/dist/js/wrapper.d.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,mBAAmB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isplayIntegration } from '../tracing/integrations/timeToDisplayIntegration';
25
25
  export { breadcrumbsIntegration } from './breadcrumbs';
26
26
  export { primitiveTagIntegration } from './primitiveTagIntegration';
27
+ export { logEnricherIntegration } from './logEnricherIntegration';
27
28
  export { browserApiErrorsIntegration, dedupeIntegration, functionToStringIntegration, globalHandlersIntegration as browserGlobalHandlersIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, linkedErrorsIntegration as browserLinkedErrorsIntegration, rewriteFramesIntegration, extraErrorDataIntegration, } from '@sentry/react';
28
29
  //# sourceMappingURL=exports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../src/js/integrations/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAC/G,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAC3B,yBAAyB,IAAI,gCAAgC,EAC7D,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,IAAI,8BAA8B,EACzD,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,eAAe,CAAC","sourcesContent":["export { debugSymbolicatorIntegration } from './debugsymbolicator';\nexport { deviceContextIntegration } from './devicecontext';\nexport { reactNativeErrorHandlersIntegration } from './reactnativeerrorhandlers';\nexport { nativeLinkedErrorsIntegration } from './nativelinkederrors';\nexport { nativeReleaseIntegration } from './release';\nexport { eventOriginIntegration } from './eventorigin';\nexport { sdkInfoIntegration } from './sdkinfo';\nexport { reactNativeInfoIntegration } from './reactnativeinfo';\nexport { modulesLoaderIntegration } from './modulesloader';\nexport { hermesProfilingIntegration } from '../profiling/integration';\nexport { screenshotIntegration } from './screenshot';\nexport { viewHierarchyIntegration } from './viewhierarchy';\nexport { expoContextIntegration } from './expocontext';\nexport { spotlightIntegration } from './spotlight';\nexport { mobileReplayIntegration } from '../replay/mobilereplay';\nexport { feedbackIntegration } from '../feedback/integration';\nexport { browserReplayIntegration } from '../replay/browserReplay';\nexport { appStartIntegration } from '../tracing/integrations/appStart';\nexport { nativeFramesIntegration, createNativeFramesIntegrations } from '../tracing/integrations/nativeFrames';\nexport { stallTrackingIntegration } from '../tracing/integrations/stalltracking';\nexport { userInteractionIntegration } from '../tracing/integrations/userInteraction';\nexport { createReactNativeRewriteFrames } from './rewriteframes';\nexport { appRegistryIntegration } from './appRegistry';\nexport { timeToDisplayIntegration } from '../tracing/integrations/timeToDisplayIntegration';\nexport { breadcrumbsIntegration } from './breadcrumbs';\nexport { primitiveTagIntegration } from './primitiveTagIntegration';\n\nexport {\n browserApiErrorsIntegration,\n dedupeIntegration,\n functionToStringIntegration,\n globalHandlersIntegration as browserGlobalHandlersIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n linkedErrorsIntegration as browserLinkedErrorsIntegration,\n rewriteFramesIntegration,\n extraErrorDataIntegration,\n} from '@sentry/react';\n"]}
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../src/js/integrations/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC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egration } from './devicecontext';\nexport { reactNativeErrorHandlersIntegration } from './reactnativeerrorhandlers';\nexport { nativeLinkedErrorsIntegration } from './nativelinkederrors';\nexport { nativeReleaseIntegration } from './release';\nexport { eventOriginIntegration } from './eventorigin';\nexport { sdkInfoIntegration } from './sdkinfo';\nexport { reactNativeInfoIntegration } from './reactnativeinfo';\nexport { modulesLoaderIntegration } from './modulesloader';\nexport { hermesProfilingIntegration } from '../profiling/integration';\nexport { screenshotIntegration } from './screenshot';\nexport { viewHierarchyIntegration } from './viewhierarchy';\nexport { expoContextIntegration } from './expocontext';\nexport { spotlightIntegration } from './spotlight';\nexport { mobileReplayIntegration } from '../replay/mobilereplay';\nexport { feedbackIntegration } from '../feedback/integration';\nexport { browserReplayIntegration } from '../replay/browserReplay';\nexport { appStartIntegration } from '../tracing/integrations/appStart';\nexport { nativeFramesIntegration, createNativeFramesIntegrations } from '../tracing/integrations/nativeFrames';\nexport { stallTrackingIntegration } from '../tracing/integrations/stalltracking';\nexport { userInteractionIntegration } from '../tracing/integrations/userInteraction';\nexport { createReactNativeRewriteFrames } from './rewriteframes';\nexport { appRegistryIntegration } from './appRegistry';\nexport { timeToDisplayIntegration } from '../tracing/integrations/timeToDisplayIntegration';\nexport { breadcrumbsIntegration } from './breadcrumbs';\nexport { primitiveTagIntegration } from './primitiveTagIntegration';\nexport { logEnricherIntegration } from './logEnricherIntegration';\n\nexport {\n browserApiErrorsIntegration,\n dedupeIntegration,\n functionToStringIntegration,\n globalHandlersIntegration as browserGlobalHandlersIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n linkedErrorsIntegration as browserLinkedErrorsIntegration,\n rewriteFramesIntegration,\n extraErrorDataIntegration,\n} from '@sentry/react';\n"]}
@@ -0,0 +1,3 @@
1
+ import type { Integration } from '@sentry/core';
2
+ export declare const logEnricherIntegration: () => Integration;
3
+ //# sourceMappingURL=logEnricherIntegration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logEnricherIntegration.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/logEnricherIntegration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAO,MAAM,cAAc,CAAC;AAOrD,eAAO,MAAM,sBAAsB,QAAO,WAkBzC,CAAC"}
@@ -0,0 +1,65 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { debug } from '@sentry/core';
11
+ import { NATIVE } from '../wrapper';
12
+ const INTEGRATION_NAME = 'LogEnricher';
13
+ export const logEnricherIntegration = () => {
14
+ return {
15
+ name: INTEGRATION_NAME,
16
+ setup(client) {
17
+ client.on('afterInit', () => {
18
+ cacheLogContext().then(() => {
19
+ client.on('beforeCaptureLog', (log) => {
20
+ processLog(log);
21
+ });
22
+ }, reason => {
23
+ debug.log(reason);
24
+ });
25
+ });
26
+ },
27
+ };
28
+ };
29
+ let NativeCache = undefined;
30
+ function cacheLogContext() {
31
+ var _a, _b, _c, _d, _e, _f;
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ try {
34
+ const response = yield NATIVE.fetchNativeLogAttributes();
35
+ NativeCache = Object.assign(Object.assign(Object.assign({}, (((_a = response === null || response === void 0 ? void 0 : response.contexts) === null || _a === void 0 ? void 0 : _a.device) && {
36
+ brand: (_b = response.contexts.device) === null || _b === void 0 ? void 0 : _b.brand,
37
+ model: (_c = response.contexts.device) === null || _c === void 0 ? void 0 : _c.model,
38
+ family: (_d = response.contexts.device) === null || _d === void 0 ? void 0 : _d.family,
39
+ })), (((_e = response === null || response === void 0 ? void 0 : response.contexts) === null || _e === void 0 ? void 0 : _e.os) && {
40
+ os: response.contexts.os.name,
41
+ version: response.contexts.os.version,
42
+ })), (((_f = response === null || response === void 0 ? void 0 : response.contexts) === null || _f === void 0 ? void 0 : _f.release) && {
43
+ release: response.contexts.release,
44
+ }));
45
+ }
46
+ catch (e) {
47
+ return Promise.reject(`[LOGS]: Failed to prepare attributes from Native Layer: ${e}`);
48
+ }
49
+ return Promise.resolve();
50
+ });
51
+ }
52
+ function processLog(log) {
53
+ var _a;
54
+ if (NativeCache === undefined) {
55
+ return;
56
+ }
57
+ log.attributes = (_a = log.attributes) !== null && _a !== void 0 ? _a : {};
58
+ NativeCache.brand && (log.attributes['device.brand'] = NativeCache.brand);
59
+ NativeCache.model && (log.attributes['device.model'] = NativeCache.model);
60
+ NativeCache.family && (log.attributes['device.family'] = NativeCache.family);
61
+ NativeCache.os && (log.attributes['os.name'] = NativeCache.os);
62
+ NativeCache.version && (log.attributes['os.version'] = NativeCache.version);
63
+ NativeCache.release && (log.attributes['sentry.release'] = NativeCache.release);
64
+ }
65
+ //# sourceMappingURL=logEnricherIntegration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logEnricherIntegration.js","sourceRoot":"","sources":["../../../src/js/integrations/logEnricherIntegration.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAgB,EAAE;IACtD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,KAAK,CAAC,MAAyB;YAC7B,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;gBAC1B,eAAe,EAAE,CAAC,IAAI,CACpB,GAAG,EAAE;oBACH,MAAM,CAAC,EAAE,CAAC,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ACvF;QACD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;;CAC1B;AAED,SAAS,UAAU,CAAC,GAAQ;;IAC1B,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,OAAO;KACR;IAED,GAAG,CAAC,UAAU,GAAG,MAAA,GAAG,CAAC,UAAU,mCAAI,EAAE,CAAC;IACtC,WAAW,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAC1E,WAAW,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAC1E,WAAW,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,eAAe,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7E,WAAW,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;IAC/D,WAAW,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5E,WAAW,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,gBAAgB,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;AAClF,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport type { Integration, Log } from '@sentry/core';\nimport { debug } from '@sentry/core';\nimport type { ReactNativeClient } from '../client';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'LogEnricher';\n\nexport const logEnricherIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setup(client: ReactNativeClient) {\n client.on('afterInit', () => {\n cacheLogContext().then(\n () => {\n client.on('beforeCaptureLog', (log: Log) => {\n processLog(log);\n });\n },\n reason => {\n debug.log(reason);\n },\n );\n });\n },\n };\n};\n\nlet NativeCache: Record<string, unknown> | undefined = undefined;\n\nasync function cacheLogContext(): Promise<void> {\n try {\n const response = await NATIVE.fetchNativeLogAttributes();\n\n NativeCache = {\n ...(response?.contexts?.device && {\n brand: response.contexts.device?.brand,\n model: response.contexts.device?.model,\n family: response.contexts.device?.family,\n }),\n ...(response?.contexts?.os && {\n os: response.contexts.os.name,\n version: response.contexts.os.version,\n }),\n ...(response?.contexts?.release && {\n release: response.contexts.release,\n }),\n };\n } catch (e) {\n return Promise.reject(`[LOGS]: Failed to prepare attributes from Native Layer: ${e}`);\n }\n return Promise.resolve();\n}\n\nfunction processLog(log: Log): void {\n if (NativeCache === undefined) {\n return;\n }\n\n log.attributes = log.attributes ?? {};\n NativeCache.brand && (log.attributes['device.brand'] = NativeCache.brand);\n NativeCache.model && (log.attributes['device.model'] = NativeCache.model);\n NativeCache.family && (log.attributes['device.family'] = NativeCache.family);\n NativeCache.os && (log.attributes['os.name'] = NativeCache.os);\n NativeCache.version && (log.attributes['os.version'] = NativeCache.version);\n NativeCache.release && (log.attributes['sentry.release'] = NativeCache.release);\n}\n"]}
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { logger } from '@sentry/core';
10
+ import { debug } from '@sentry/core';
11
11
  import { NATIVE } from '../wrapper';
12
12
  const INTEGRATION_NAME = 'ModulesLoader';
13
13
  /** Loads runtime JS modules from prepared file. */
@@ -29,7 +29,7 @@ function createProcessEvent() {
29
29
  modules = yield NATIVE.fetchModules();
30
30
  }
31
31
  catch (e) {
32
- logger.log(`Failed to get modules from native: ${e}`);
32
+ debug.log(`Failed to get modules from native: ${e}`);
33
33
  }
34
34
  isSetup = true;
35
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"modulesloader.js","sourceRoot":"","sources":["../../../src/js/integrations/modulesloader.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,mDAAmD;AACnD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAgB,EAAE;IACxD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY,EAAE,kBAAkB,EAAE;KACnC,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,kBAAkB;IACzB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,OAAO,GAAkC,IAAI,CAAC;IAElD,OAAO,CAAO,KAAY,EAAE,EAAE;QAC5B,IAAI,CAAC,OAAO,EAAE;YACZ,IAAI;gBACF,OAAO,GAAG,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;aACvC;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,GAAG,CAAC,sCAAsC,CAAC,EAAE,CAAC,CAAC;aACvD;YACD,OAAO,GAAG,IAAI,CAAC;SAChB;QACD,IAAI,OAAO,EAAE;YACX,KAAK,CAAC,OAAO,mCACR,OAAO,GACP,KAAK,CAAC,OAAO,CACjB,CAAC;SACH;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAA,CAAC;AACJ,CAAC","sourcesContent":["import type { Event, Integration } from '@sentry/core';\nimport { logger } from '@sentry/core';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'ModulesLoader';\n\n/** Loads runtime JS modules from prepared file. */\nexport const modulesLoaderIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent: createProcessEvent(),\n };\n};\n\nfunction createProcessEvent(): (event: Event) => Promise<Event> {\n let isSetup = false;\n let modules: Record<string, string> | null = null;\n\n return async (event: Event) => {\n if (!isSetup) {\n try {\n modules = await NATIVE.fetchModules();\n } catch (e) {\n logger.log(`Failed to get modules from native: ${e}`);\n }\n isSetup = true;\n }\n if (modules) {\n event.modules = {\n ...modules,\n ...event.modules,\n };\n }\n return event;\n };\n}\n"]}
1
+ {"version":3,"file":"modulesloader.js","sourceRoot":"","sources":["../../../src/js/integrations/modulesloader.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,mDAAmD;AACnD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAgB,EAAE;IACxD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY,EAAE,kBAAkB,EAAE;KACnC,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,kBAAkB;IACzB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,OAAO,GAAkC,IAAI,CAAC;IAElD,OAAO,CAAO,KAAY,EAAE,EAAE;QAC5B,IAAI,CAAC,OAAO,EAAE;YACZ,IAAI;gBACF,OAAO,GAAG,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;aACvC;YAAC,OAAO,CAAC,EAAE;gBACV,KAAK,CAAC,GAAG,CAAC,sCAAsC,CAAC,EAAE,CAAC,CAAC;aACtD;YACD,OAAO,GAAG,IAAI,CAAC;SAChB;QACD,IAAI,OAAO,EAAE;YACX,KAAK,CAAC,OAAO,mCACR,OAAO,GACP,KAAK,CAAC,OAAO,CACjB,CAAC;SACH;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAA,CAAC;AACJ,CAAC","sourcesContent":["import type { Event, Integration } from '@sentry/core';\nimport { debug } from '@sentry/core';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'ModulesLoader';\n\n/** Loads runtime JS modules from prepared file. */\nexport const modulesLoaderIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent: createProcessEvent(),\n };\n};\n\nfunction createProcessEvent(): (event: Event) => Promise<Event> {\n let isSetup = false;\n let modules: Record<string, string> | null = null;\n\n return async (event: Event) => {\n if (!isSetup) {\n try {\n modules = await NATIVE.fetchModules();\n } catch (e) {\n debug.log(`Failed to get modules from native: ${e}`);\n }\n isSetup = true;\n }\n if (modules) {\n event.modules = {\n ...modules,\n ...event.modules,\n };\n }\n return event;\n };\n}\n"]}
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { addExceptionMechanism, addGlobalUnhandledRejectionInstrumentationHandler, captureException, getClient, getCurrentScope, logger, } from '@sentry/core';
10
+ import { addExceptionMechanism, addGlobalUnhandledRejectionInstrumentationHandler, captureException, debug, getClient, getCurrentScope, } from '@sentry/core';
11
11
  import { isHermesEnabled, isWeb } from '../utils/environment';
12
12
  import { createSyntheticError, isErrorLike } from '../utils/error';
13
13
  import { RN_GLOBAL_OBJ } from '../utils/worldwide';
@@ -33,16 +33,16 @@ function setupUnhandledRejectionsTracking(patchGlobalPromise) {
33
33
  if (isHermesEnabled() &&
34
34
  ((_a = RN_GLOBAL_OBJ.HermesInternal) === null || _a === void 0 ? void 0 : _a.enablePromiseRejectionTracker) &&
35
35
  ((_c = (_b = RN_GLOBAL_OBJ === null || RN_GLOBAL_OBJ === void 0 ? void 0 : RN_GLOBAL_OBJ.HermesInternal) === null || _b === void 0 ? void 0 : _b.hasPromise) === null || _c === void 0 ? void 0 : _c.call(_b))) {
36
- logger.log('Using Hermes native promise rejection tracking');
36
+ debug.log('Using Hermes native promise rejection tracking');
37
37
  RN_GLOBAL_OBJ.HermesInternal.enablePromiseRejectionTracker({
38
38
  allRejections: true,
39
39
  onUnhandled: promiseRejectionTrackingOptions.onUnhandled,
40
40
  onHandled: promiseRejectionTrackingOptions.onHandled,
41
41
  });
42
- logger.log('Unhandled promise rejections will be caught by Sentry.');
42
+ debug.log('Unhandled promise rejections will be caught by Sentry.');
43
43
  }
44
44
  else if (isWeb()) {
45
- logger.log('Using Browser JS promise rejection tracking for React Native Web');
45
+ debug.log('Using Browser JS promise rejection tracking for React Native Web');
46
46
  // Use Sentry's built-in global unhandled rejection handler
47
47
  addGlobalUnhandledRejectionInstrumentationHandler((error) => {
48
48
  captureException(error, {
@@ -60,11 +60,11 @@ function setupUnhandledRejectionsTracking(patchGlobalPromise) {
60
60
  }
61
61
  else {
62
62
  // For JSC and other environments, patching was disabled by user configuration
63
- logger.log('Unhandled promise rejections will not be caught by Sentry.');
63
+ debug.log('Unhandled promise rejections will not be caught by Sentry.');
64
64
  }
65
65
  }
66
66
  catch (e) {
67
- logger.warn('Failed to set up promise rejection tracking. ' +
67
+ debug.warn('Failed to set up promise rejection tracking. ' +
68
68
  'Unhandled promise rejections will not be caught by Sentry.' +
69
69
  'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.');
70
70
  }
@@ -72,7 +72,7 @@ function setupUnhandledRejectionsTracking(patchGlobalPromise) {
72
72
  const promiseRejectionTrackingOptions = {
73
73
  onUnhandled: (id, error, rejection = {}) => {
74
74
  if (__DEV__) {
75
- logger.warn(`Possible Unhandled Promise Rejection (id: ${id}):\n${rejection}`);
75
+ debug.warn(`Possible Unhandled Promise Rejection (id: ${id}):\n${rejection}`);
76
76
  }
77
77
  // Marking the rejection as handled to avoid breaking crash rate calculations.
78
78
  // See: https://github.com/getsentry/sentry-react-native/issues/4141
@@ -85,7 +85,7 @@ const promiseRejectionTrackingOptions = {
85
85
  },
86
86
  onHandled: id => {
87
87
  if (__DEV__) {
88
- logger.warn(`Promise Rejection Handled (id: ${id})\n` +
88
+ debug.warn(`Promise Rejection Handled (id: ${id})\n` +
89
89
  'This means you can ignore any previous messages of the form ' +
90
90
  `"Possible Unhandled Promise Rejection (id: ${id}):"`);
91
91
  }
@@ -104,7 +104,7 @@ function setupErrorUtilsGlobalHandler() {
104
104
  let handlingFatal = false;
105
105
  const errorUtils = RN_GLOBAL_OBJ.ErrorUtils;
106
106
  if (!errorUtils) {
107
- logger.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');
107
+ debug.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');
108
108
  return;
109
109
  }
110
110
  const defaultHandler = (_a = errorUtils.getGlobalHandler) === null || _a === void 0 ? void 0 : _a.call(errorUtils);
@@ -114,14 +114,14 @@ function setupErrorUtilsGlobalHandler() {
114
114
  const shouldHandleFatal = isFatal && !__DEV__;
115
115
  if (shouldHandleFatal) {
116
116
  if (handlingFatal) {
117
- logger.log('Encountered multiple fatals in a row. The latest:', error);
117
+ debug.log('Encountered multiple fatals in a row. The latest:', error);
118
118
  return;
119
119
  }
120
120
  handlingFatal = true;
121
121
  }
122
122
  const client = getClient();
123
123
  if (!client) {
124
- logger.error('Sentry client is missing, the error event might be lost.', error);
124
+ debug.error('Sentry client is missing, the error event might be lost.', error);
125
125
  // If there is no client something is fishy, anyway we call the default handler
126
126
  defaultHandler(error, isFatal);
127
127
  return;
@@ -155,7 +155,7 @@ function setupErrorUtilsGlobalHandler() {
155
155
  void client.flush(client.getOptions().shutdownTimeout || 2000).then(() => {
156
156
  defaultHandler(error, isFatal);
157
157
  }, (reason) => {
158
- logger.error('[ReactNativeErrorHandlers] Error while flushing the event cache after uncaught error.', reason);
158
+ debug.error('[ReactNativeErrorHandlers] Error while flushing the event cache after uncaught error.', reason);
159
159
  });
160
160
  }));
161
161
  }
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EACL,qBAAqB,EACrB,iDAAiD,EACjD,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,MAAM,GACP,MAAM,cAAc,CAAC;AAEtB,OAAO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YAEhF,+EAA+E;YAC/E,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAE/B,OAAO;SACR;QAED,MAAM,IAAI,GAAc;YACtB,iBAAiB,EAAE,KAAK;YACxB,WAAW,EAAE,eAAe,EAAE,CAAC,YAAY,EAAE,CAAC,WAAW;SAC1D,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAE3D,IAAI,OAAO,EAAE;YACX,KAAK,CAAC,KAAK,GAAG,OAAwB,CAAC;YAEvC,qBAAqB,CAAC,KAAK,EAAE;gBAC3B,OAAO,EAAE,KAAK;gBACd,IAAI,EAAE,SAAS;aAChB,CAAC,CAAC;SACJ;aAAM;YACL,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC;YAEtB,qBAAqB,CAAC,KAAK,EAAE;gBAC3B,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,SAAS;aAChB,CAAC,CAAC;SACJ;QAED,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEjC,IAAI,OAAO,EAAE;YACX,gFAAgF;YAChF,mCAAmC;YACnC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC/B,OAAO;SACR;QAED,KAAK,MAAM,CAAC,KAAK,CAAE,MAAM,CAAC,UAAU,EAA+B,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,IAAI,CAC/F,GAAG,EAAE;YACH,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACjC,CAAC,EACD,CAAC,MAAe,EAAE,EAAE;YAClB,MAAM,CAAC,KAAK,CAAC,uFAAuF,EAAE,MAAM,CAAC,CAAC;QAChH,CAAC,CACF,CAAC;IACJ,CAAC,CAAA,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { EventHint, Integration, SeverityLevel } from '@sentry/core';\nimport {\n addExceptionMechanism,\n addGlobalUnhandledRejectionInstrumentationHandler,\n captureException,\n getClient,\n getCurrentScope,\n logger,\n} from '@sentry/core';\nimport type { ReactNativeClientOptions } from '../options';\nimport { isHermesEnabled, isWeb } from '../utils/environment';\nimport { createSyntheticError, isErrorLike } from '../utils/error';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport { checkPromiseAndWarn, polyfillPromise, requireRejectionTracking } from './reactnativeerrorhandlersutils';\n\nconst INTEGRATION_NAME = 'ReactNativeErrorHandlers';\n\n/** ReactNativeErrorHandlers Options */\ninterface ReactNativeErrorHandlersOptions {\n onerror: boolean;\n onunhandledrejection: boolean;\n patchGlobalPromise: boolean;\n}\n\ninterface PromiseRejectionTrackingOptions {\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n/** ReactNativeErrorHandlers Integration */\nexport const reactNativeErrorHandlersIntegration = (\n options: Partial<ReactNativeErrorHandlersOptions> = {},\n): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () =>\n setup({\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n }),\n };\n};\n\nfunction setup(options: ReactNativeErrorHandlersOptions): void {\n options.onunhandledrejection && setupUnhandledRejectionsTracking(options.patchGlobalPromise);\n options.onerror && setupErrorUtilsGlobalHandler();\n}\n\n/**\n * Setup unhandled promise rejection tracking\n */\nfunction setupUnhandledRejectionsTracking(patchGlobalPromise: boolean): void {\n try {\n if (\n isHermesEnabled() &&\n RN_GLOBAL_OBJ.HermesInternal?.enablePromiseRejectionTracker &&\n RN_GLOBAL_OBJ?.HermesInternal?.hasPromise?.()\n ) {\n logger.log('Using Hermes native promise rejection tracking');\n\n RN_GLOBAL_OBJ.HermesInternal.enablePromiseRejectionTracker({\n allRejections: true,\n onUnhandled: promiseRejectionTrackingOptions.onUnhandled,\n onHandled: promiseRejectionTrackingOptions.onHandled,\n });\n\n logger.log('Unhandled promise rejections will be caught by Sentry.');\n } else if (isWeb()) {\n logger.log('Using Browser JS promise rejection tracking for React Native Web');\n\n // Use Sentry's built-in global unhandled rejection handler\n addGlobalUnhandledRejectionInstrumentationHandler((error: unknown) => {\n captureException(error, {\n originalException: error,\n syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),\n mechanism: { handled: false, type: 'onunhandledrejection' },\n });\n });\n } else if (patchGlobalPromise) {\n // For JSC and other environments, use the existing approach\n polyfillPromise();\n attachUnhandledRejectionHandler();\n checkPromiseAndWarn();\n } else {\n // For JSC and other environments, patching was disabled by user configuration\n logger.log('Unhandled promise rejections will not be caught by Sentry.');\n }\n } catch (e) {\n logger.warn(\n 'Failed to set up promise rejection tracking. ' +\n 'Unhandled promise rejections will not be caught by Sentry.' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n}\n\nconst promiseRejectionTrackingOptions: PromiseRejectionTrackingOptions = {\n onUnhandled: (id, error: unknown, rejection = {}) => {\n if (__DEV__) {\n logger.warn(`Possible Unhandled Promise Rejection (id: ${id}):\\n${rejection}`);\n }\n\n // Marking the rejection as handled to avoid breaking crash rate calculations.\n // See: https://github.com/getsentry/sentry-react-native/issues/4141\n captureException(error, {\n data: { id },\n originalException: error,\n syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),\n mechanism: { handled: true, type: 'onunhandledrejection' },\n });\n },\n onHandled: id => {\n if (__DEV__) {\n logger.warn(\n `Promise Rejection Handled (id: ${id})\\n` +\n 'This means you can ignore any previous messages of the form ' +\n `\"Possible Unhandled Promise Rejection (id: ${id}):\"`,\n );\n }\n },\n};\n\nfunction attachUnhandledRejectionHandler(): void {\n const tracking = requireRejectionTracking();\n\n tracking.enable({\n allRejections: true,\n onUnhandled: promiseRejectionTrackingOptions.onUnhandled,\n onHandled: promiseRejectionTrackingOptions.onHandled,\n });\n}\n\nfunction setupErrorUtilsGlobalHandler(): void {\n let handlingFatal = false;\n\n const errorUtils = RN_GLOBAL_OBJ.ErrorUtils;\n if (!errorUtils) {\n logger.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');\n return;\n }\n\n const defaultHandler = errorUtils.getGlobalHandler?.();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n errorUtils.setGlobalHandler(async (error: any, isFatal?: boolean) => {\n // We want to handle fatals, but only in production mode.\n const shouldHandleFatal = isFatal && !__DEV__;\n if (shouldHandleFatal) {\n if (handlingFatal) {\n logger.log('Encountered multiple fatals in a row. The latest:', error);\n return;\n }\n handlingFatal = true;\n }\n\n const client = getClient();\n\n if (!client) {\n logger.error('Sentry client is missing, the error event might be lost.', error);\n\n // If there is no client something is fishy, anyway we call the default handler\n defaultHandler(error, isFatal);\n\n return;\n }\n\n const hint: EventHint = {\n originalException: error,\n attachments: getCurrentScope().getScopeData().attachments,\n };\n const event = await client.eventFromException(error, hint);\n\n if (isFatal) {\n event.level = 'fatal' as SeverityLevel;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n } else {\n event.level = 'error';\n\n addExceptionMechanism(event, {\n handled: true,\n type: 'generic',\n });\n }\n\n client.captureEvent(event, hint);\n\n if (__DEV__) {\n // If in dev, we call the default handler anyway and hope the error will be sent\n // Just for a better dev experience\n defaultHandler(error, isFatal);\n return;\n }\n\n void client.flush((client.getOptions() as ReactNativeClientOptions).shutdownTimeout || 2000).then(\n () => {\n defaultHandler(error, isFatal);\n },\n (reason: unknown) => {\n logger.error('[ReactNativeErrorHandlers] Error while flushing the event cache after uncaught error.', reason);\n },\n );\n });\n}\n"]}
1
+ {"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EACL,qBAAqB,EACrB,iDAAiD,EACjD,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,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;YACtB,iBAAiB,EAAE,KAAK;YACxB,WAAW,EAAE,eAAe,EAAE,CAAC,YAAY,EAAE,CAAC,WAAW;SAC1D,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAE3D,IAAI,OAAO,EAAE;YACX,KAAK,CAAC,KAAK,GAAG,OAAwB,CAAC;YAEvC,qBAAqB,CAAC,KAAK,EAAE;gBAC3B,OAAO,EAAE,KAAK;gBACd,IAAI,EAAE,SAAS;aAChB,CAAC,CAAC;SACJ;aAAM;YACL,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC;YAEtB,qBAAqB,CAAC,KAAK,EAAE;gBAC3B,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,SAAS;aAChB,CAAC,CAAC;SACJ;QAED,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEjC,IAAI,OAAO,EAAE;YACX,gFAAgF;YAChF,mCAAmC;YACnC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC/B,OAAO;SACR;QAED,KAAK,MAAM,CAAC,KAAK,CAAE,MAAM,CAAC,UAAU,EAA+B,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,IAAI,CAC/F,GAAG,EAAE;YACH,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACjC,CAAC,EACD,CAAC,MAAe,EAAE,EAAE;YAClB,KAAK,CAAC,KAAK,CAAC,uFAAuF,EAAE,MAAM,CAAC,CAAC;QAC/G,CAAC,CACF,CAAC;IACJ,CAAC,CAAA,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { EventHint, Integration, SeverityLevel } from '@sentry/core';\nimport {\n addExceptionMechanism,\n addGlobalUnhandledRejectionInstrumentationHandler,\n captureException,\n debug,\n getClient,\n getCurrentScope,\n} from '@sentry/core';\nimport type { ReactNativeClientOptions } from '../options';\nimport { isHermesEnabled, isWeb } from '../utils/environment';\nimport { createSyntheticError, isErrorLike } from '../utils/error';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport { checkPromiseAndWarn, polyfillPromise, requireRejectionTracking } from './reactnativeerrorhandlersutils';\n\nconst INTEGRATION_NAME = 'ReactNativeErrorHandlers';\n\n/** ReactNativeErrorHandlers Options */\ninterface ReactNativeErrorHandlersOptions {\n onerror: boolean;\n onunhandledrejection: boolean;\n patchGlobalPromise: boolean;\n}\n\ninterface PromiseRejectionTrackingOptions {\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n/** ReactNativeErrorHandlers Integration */\nexport const reactNativeErrorHandlersIntegration = (\n options: Partial<ReactNativeErrorHandlersOptions> = {},\n): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () =>\n setup({\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n }),\n };\n};\n\nfunction setup(options: ReactNativeErrorHandlersOptions): void {\n options.onunhandledrejection && setupUnhandledRejectionsTracking(options.patchGlobalPromise);\n options.onerror && setupErrorUtilsGlobalHandler();\n}\n\n/**\n * Setup unhandled promise rejection tracking\n */\nfunction setupUnhandledRejectionsTracking(patchGlobalPromise: boolean): void {\n try {\n if (\n isHermesEnabled() &&\n RN_GLOBAL_OBJ.HermesInternal?.enablePromiseRejectionTracker &&\n RN_GLOBAL_OBJ?.HermesInternal?.hasPromise?.()\n ) {\n debug.log('Using Hermes native promise rejection tracking');\n\n RN_GLOBAL_OBJ.HermesInternal.enablePromiseRejectionTracker({\n allRejections: true,\n onUnhandled: promiseRejectionTrackingOptions.onUnhandled,\n onHandled: promiseRejectionTrackingOptions.onHandled,\n });\n\n debug.log('Unhandled promise rejections will be caught by Sentry.');\n } else if (isWeb()) {\n debug.log('Using Browser JS promise rejection tracking for React Native Web');\n\n // Use Sentry's built-in global unhandled rejection handler\n addGlobalUnhandledRejectionInstrumentationHandler((error: unknown) => {\n captureException(error, {\n originalException: error,\n syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),\n mechanism: { handled: false, type: 'onunhandledrejection' },\n });\n });\n } else if (patchGlobalPromise) {\n // For JSC and other environments, use the existing approach\n polyfillPromise();\n attachUnhandledRejectionHandler();\n checkPromiseAndWarn();\n } else {\n // For JSC and other environments, patching was disabled by user configuration\n debug.log('Unhandled promise rejections will not be caught by Sentry.');\n }\n } catch (e) {\n debug.warn(\n 'Failed to set up promise rejection tracking. ' +\n 'Unhandled promise rejections will not be caught by Sentry.' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n}\n\nconst promiseRejectionTrackingOptions: PromiseRejectionTrackingOptions = {\n onUnhandled: (id, error: unknown, rejection = {}) => {\n if (__DEV__) {\n debug.warn(`Possible Unhandled Promise Rejection (id: ${id}):\\n${rejection}`);\n }\n\n // Marking the rejection as handled to avoid breaking crash rate calculations.\n // See: https://github.com/getsentry/sentry-react-native/issues/4141\n captureException(error, {\n data: { id },\n originalException: error,\n syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),\n mechanism: { handled: true, type: 'onunhandledrejection' },\n });\n },\n onHandled: id => {\n if (__DEV__) {\n debug.warn(\n `Promise Rejection Handled (id: ${id})\\n` +\n 'This means you can ignore any previous messages of the form ' +\n `\"Possible Unhandled Promise Rejection (id: ${id}):\"`,\n );\n }\n },\n};\n\nfunction attachUnhandledRejectionHandler(): void {\n const tracking = requireRejectionTracking();\n\n tracking.enable({\n allRejections: true,\n onUnhandled: promiseRejectionTrackingOptions.onUnhandled,\n onHandled: promiseRejectionTrackingOptions.onHandled,\n });\n}\n\nfunction setupErrorUtilsGlobalHandler(): void {\n let handlingFatal = false;\n\n const errorUtils = RN_GLOBAL_OBJ.ErrorUtils;\n if (!errorUtils) {\n debug.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');\n return;\n }\n\n const defaultHandler = errorUtils.getGlobalHandler?.();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n errorUtils.setGlobalHandler(async (error: any, isFatal?: boolean) => {\n // We want to handle fatals, but only in production mode.\n const shouldHandleFatal = isFatal && !__DEV__;\n if (shouldHandleFatal) {\n if (handlingFatal) {\n debug.log('Encountered multiple fatals in a row. The latest:', error);\n return;\n }\n handlingFatal = true;\n }\n\n const client = getClient();\n\n if (!client) {\n debug.error('Sentry client is missing, the error event might be lost.', error);\n\n // If there is no client something is fishy, anyway we call the default handler\n defaultHandler(error, isFatal);\n\n return;\n }\n\n const hint: EventHint = {\n originalException: error,\n attachments: getCurrentScope().getScopeData().attachments,\n };\n const event = await client.eventFromException(error, hint);\n\n if (isFatal) {\n event.level = 'fatal' as SeverityLevel;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n } else {\n event.level = 'error';\n\n addExceptionMechanism(event, {\n handled: true,\n type: 'generic',\n });\n }\n\n client.captureEvent(event, hint);\n\n if (__DEV__) {\n // If in dev, we call the default handler anyway and hope the error will be sent\n // Just for a better dev experience\n defaultHandler(error, isFatal);\n return;\n }\n\n void client.flush((client.getOptions() as ReactNativeClientOptions).shutdownTimeout || 2000).then(\n () => {\n defaultHandler(error, isFatal);\n },\n (reason: unknown) => {\n debug.error('[ReactNativeErrorHandlers] Error while flushing the event cache after uncaught error.', reason);\n },\n );\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { logger } from '@sentry/core';
1
+ import { debug } from '@sentry/core';
2
2
  import { ReactNativeLibraries } from '../utils/rnlibraries';
3
3
  import { RN_GLOBAL_OBJ } from '../utils/worldwide';
4
4
  /**
@@ -12,7 +12,7 @@ import { RN_GLOBAL_OBJ } from '../utils/worldwide';
12
12
  */
13
13
  export function polyfillPromise() {
14
14
  if (!ReactNativeLibraries.Utilities) {
15
- logger.warn('Could not polyfill Promise. React Native Libraries Utilities not found.');
15
+ debug.warn('Could not polyfill Promise. React Native Libraries Utilities not found.');
16
16
  return;
17
17
  }
18
18
  const Promise = getPromisePolyfill();
@@ -54,23 +54,23 @@ export function checkPromiseAndWarn() {
54
54
  const PromisePackagePromise = require('promise/setimmediate/es6-extensions');
55
55
  const UsedPromisePolyfill = getPromisePolyfill();
56
56
  if (ReactNativePromise !== PromisePackagePromise) {
57
- logger.warn('You appear to have multiple versions of the "promise" package installed. ' +
57
+ debug.warn('You appear to have multiple versions of the "promise" package installed. ' +
58
58
  'This may cause unexpected behavior like undefined `Promise.allSettled`. ' +
59
59
  'Please install the `promise` package manually using the exact version as the React Native package. ' +
60
60
  'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.');
61
61
  }
62
62
  // This only make sense if the user disabled the integration Polyfill
63
63
  if (UsedPromisePolyfill !== RN_GLOBAL_OBJ.Promise) {
64
- logger.warn('Unhandled promise rejections will not be caught by Sentry. ' +
64
+ debug.warn('Unhandled promise rejections will not be caught by Sentry. ' +
65
65
  'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.');
66
66
  }
67
67
  else {
68
- logger.log('Unhandled promise rejections will be caught by Sentry.');
68
+ debug.log('Unhandled promise rejections will be caught by Sentry.');
69
69
  }
70
70
  }
71
71
  catch (e) {
72
72
  // Do Nothing
73
- logger.warn('Unhandled promise rejections will not be caught by Sentry. ' +
73
+ debug.warn('Unhandled promise rejections will not be caught by Sentry. ' +
74
74
  'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.');
75
75
  }
76
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"reactnativeerrorhandlersutils.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlersutils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC,oBAAoB,CAAC,SAAS,EAAE;QACnC,MAAM,CAAC,IAAI,CAAC,yEAAyE,CAAC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,CACT,6DAA6D;YAC3D,sFAAsF,CACzF,CAAC;KACH;AACH,CAAC","sourcesContent":["import { logger } from '@sentry/core';\nimport { ReactNativeLibraries } from '../utils/rnlibraries';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\n/**\n * Polyfill the global promise instance with one we can be sure that we can attach the tracking to.\n *\n * In newer RN versions >=0.63, the global promise is not the same reference as the one imported from the promise library.\n * This is due to a version mismatch between promise versions.\n * Originally we tried a solution where we would have you put a package resolution to ensure the promise instances match. However,\n * - Using a package resolution requires the you to manually troubleshoot.\n * - The package resolution fix no longer works with 0.67 on iOS Hermes.\n */\nexport function polyfillPromise(): void {\n if (!ReactNativeLibraries.Utilities) {\n logger.warn('Could not polyfill Promise. React Native Libraries Utilities not found.');\n return;\n }\n\n const Promise = getPromisePolyfill();\n\n // As of RN 0.67 only done and finally are used\n // eslint-disable-next-line import/no-extraneous-dependencies\n require('promise/setimmediate/done');\n // eslint-disable-next-line import/no-extraneous-dependencies\n require('promise/setimmediate/finally');\n\n ReactNativeLibraries.Utilities.polyfillGlobal('Promise', () => Promise);\n}\n\n/**\n * Single source of truth for the Promise implementation we want to use.\n * This is important for verifying that the rejected promise tracing will work as expected.\n */\nexport function getPromisePolyfill(): unknown {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n // Below, we follow the exact way React Native initializes its promise library, and we globally replace it.\n return require('promise/setimmediate/es6-extensions');\n}\n\n/**\n * Lazy require the rejection tracking module\n */\nexport function requireRejectionTracking(): {\n disable: () => void;\n enable: (arg: unknown) => void;\n} {\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n return require('promise/setimmediate/rejection-tracking');\n}\n\n/**\n * Checks if the promise is the same one or not, if not it will warn the user\n */\nexport function checkPromiseAndWarn(): void {\n try {\n // `promise` package is a dependency of react-native, therefore it is always available.\n // but it is possible that the user has installed a different version of promise\n // or dependency that uses a different version.\n // We have to check if the React Native Promise and the `promise` package Promise are using the same reference.\n // If they are not, likely there are multiple versions of the `promise` package installed.\n const ReactNativePromise = ReactNativeLibraries.Promise;\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const PromisePackagePromise = require('promise/setimmediate/es6-extensions');\n const UsedPromisePolyfill = getPromisePolyfill();\n\n if (ReactNativePromise !== PromisePackagePromise) {\n logger.warn(\n 'You appear to have multiple versions of the \"promise\" package installed. ' +\n 'This may cause unexpected behavior like undefined `Promise.allSettled`. ' +\n 'Please install the `promise` package manually using the exact version as the React Native package. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n\n // This only make sense if the user disabled the integration Polyfill\n if (UsedPromisePolyfill !== RN_GLOBAL_OBJ.Promise) {\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n } else {\n logger.log('Unhandled promise rejections will be caught by Sentry.');\n }\n } catch (e) {\n // Do Nothing\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n}\n"]}
1
+ {"version":3,"file":"reactnativeerrorhandlersutils.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlersutils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC,oBAAoB,CAAC,SAAS,EAAE;QACnC,KAAK,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;QACtF,OAAO;KACR;IAED,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,+CAA+C;IAC/C,6DAA6D;IAC7D,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACrC,6DAA6D;IAC7D,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAExC,oBAAoB,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC;AAC1E,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,yFAAyF;IACzF,2GAA2G;IAC3G,OAAO,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB;IAItC,gGAAgG;IAChG,OAAO,OAAO,CAAC,yCAAyC,CAAC,CAAC;AAC5D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,IAAI;QACF,uFAAuF;QACvF,gFAAgF;QAChF,+CAA+C;QAC/C,+GAA+G;QAC/G,0FAA0F;QAC1F,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,OAAO,CAAC;QACxD,gGAAgG;QAChG,MAAM,qBAAqB,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;QAC7E,MAAM,mBAAmB,GAAG,kBAAkB,EAAE,CAAC;QAEjD,IAAI,kBAAkB,KAAK,qBAAqB,EAAE;YAChD,KAAK,CAAC,IAAI,CACR,2EAA2E;gBACzE,0EAA0E;gBAC1E,qGAAqG;gBACrG,sFAAsF,CACzF,CAAC;SACH;QAED,qEAAqE;QACrE,IAAI,mBAAmB,KAAK,aAAa,CAAC,OAAO,EAAE;YACjD,KAAK,CAAC,IAAI,CACR,6DAA6D;gBAC3D,sFAAsF,CACzF,CAAC;SACH;aAAM;YACL,KAAK,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;SACrE;KACF;IAAC,OAAO,CAAC,EAAE;QACV,aAAa;QACb,KAAK,CAAC,IAAI,CACR,6DAA6D;YAC3D,sFAAsF,CACzF,CAAC;KACH;AACH,CAAC","sourcesContent":["import { debug } from '@sentry/core';\nimport { ReactNativeLibraries } from '../utils/rnlibraries';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\n\n/**\n * Polyfill the global promise instance with one we can be sure that we can attach the tracking to.\n *\n * In newer RN versions >=0.63, the global promise is not the same reference as the one imported from the promise library.\n * This is due to a version mismatch between promise versions.\n * Originally we tried a solution where we would have you put a package resolution to ensure the promise instances match. However,\n * - Using a package resolution requires the you to manually troubleshoot.\n * - The package resolution fix no longer works with 0.67 on iOS Hermes.\n */\nexport function polyfillPromise(): void {\n if (!ReactNativeLibraries.Utilities) {\n debug.warn('Could not polyfill Promise. React Native Libraries Utilities not found.');\n return;\n }\n\n const Promise = getPromisePolyfill();\n\n // As of RN 0.67 only done and finally are used\n // eslint-disable-next-line import/no-extraneous-dependencies\n require('promise/setimmediate/done');\n // eslint-disable-next-line import/no-extraneous-dependencies\n require('promise/setimmediate/finally');\n\n ReactNativeLibraries.Utilities.polyfillGlobal('Promise', () => Promise);\n}\n\n/**\n * Single source of truth for the Promise implementation we want to use.\n * This is important for verifying that the rejected promise tracing will work as expected.\n */\nexport function getPromisePolyfill(): unknown {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n // Below, we follow the exact way React Native initializes its promise library, and we globally replace it.\n return require('promise/setimmediate/es6-extensions');\n}\n\n/**\n * Lazy require the rejection tracking module\n */\nexport function requireRejectionTracking(): {\n disable: () => void;\n enable: (arg: unknown) => void;\n} {\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n return require('promise/setimmediate/rejection-tracking');\n}\n\n/**\n * Checks if the promise is the same one or not, if not it will warn the user\n */\nexport function checkPromiseAndWarn(): void {\n try {\n // `promise` package is a dependency of react-native, therefore it is always available.\n // but it is possible that the user has installed a different version of promise\n // or dependency that uses a different version.\n // We have to check if the React Native Promise and the `promise` package Promise are using the same reference.\n // If they are not, likely there are multiple versions of the `promise` package installed.\n const ReactNativePromise = ReactNativeLibraries.Promise;\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const PromisePackagePromise = require('promise/setimmediate/es6-extensions');\n const UsedPromisePolyfill = getPromisePolyfill();\n\n if (ReactNativePromise !== PromisePackagePromise) {\n debug.warn(\n 'You appear to have multiple versions of the \"promise\" package installed. ' +\n 'This may cause unexpected behavior like undefined `Promise.allSettled`. ' +\n 'Please install the `promise` package manually using the exact version as the React Native package. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n\n // This only make sense if the user disabled the integration Polyfill\n if (UsedPromisePolyfill !== RN_GLOBAL_OBJ.Promise) {\n debug.warn(\n 'Unhandled promise rejections will not be caught by Sentry. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n } else {\n debug.log('Unhandled promise rejections will be caught by Sentry.');\n }\n } catch (e) {\n // Do Nothing\n debug.warn(\n 'Unhandled promise rejections will not be caught by Sentry. ' +\n 'See https://docs.sentry.io/platforms/react-native/troubleshooting/ for more details.',\n );\n }\n}\n"]}
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { logger } from '@sentry/core';
10
+ import { debug } from '@sentry/core';
11
11
  import { isExpoGo, notWeb } from '../utils/environment';
12
12
  import { SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION } from '../version';
13
13
  import { NATIVE } from '../wrapper';
@@ -41,7 +41,7 @@ function processEvent(event, fetchNativeSdkInfo) {
41
41
  event.sdk.name = event.sdk.name || defaultSdkInfo.name;
42
42
  event.sdk.version = event.sdk.version || defaultSdkInfo.version;
43
43
  event.sdk.packages = [
44
- // default packages are added by baseclient and should not be added here
44
+ // default packages are added by js client and should not be added here
45
45
  ...(event.sdk.packages || []),
46
46
  ...((nativeSdkPackage && [nativeSdkPackage]) || []),
47
47
  ];
@@ -65,7 +65,7 @@ function createCachedFetchNativeSdkInfo() {
65
65
  isCached = true;
66
66
  }
67
67
  catch (e) {
68
- logger.warn('Could not fetch native sdk info.', e);
68
+ debug.warn('Could not fetch native sdk info.', e);
69
69
  }
70
70
  return nativeSdkPackageCache;
71
71
  });
@@ -1 +1 @@
1
- {"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAInC,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,WAAW;SACrB;KACF;IACD,OAAO,EAAE,WAAW;CACrB,CAAC;AAEF,sCAAsC;AACtC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAgB,EAAE;IAClD,MAAM,kBAAkB,GAAG,8BAA8B,EAAE,CAAC;IAE5D,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY,EAAE,CAAC,KAAY,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,kBAAkB,CAAC;KACxE,CAAC;AACJ,CAAC,CAAC;AAEF,SAAe,YAAY,CAAC,KAAY,EAAE,kBAAiD;;QACzF,MAAM,gBAAgB,GAAG,MAAM,kBAAkB,EAAE,CAAC;QAEpD,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,YAAY,CAAC;QAChD,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC;QAC5B,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC;QACvD,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC;QAChE,KAAK,CAAC,GAAG,CAAC,QAAQ,GAAG;YACnB,wEAAwE;YACxE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;YAC7B,GAAG,CAAC,CAAC,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAC;SACpD,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;CAAA;AAED,SAAS,8BAA8B;IACrC,IAAI,CAAC,MAAM,EAAE,IAAI,QAAQ,EAAE,EAAE;QAC3B,OAAO,GAAG,EAAE;YACV,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC,CAAC;KACH;IAED,IAAI,QAAQ,GAAY,KAAK,CAAC;IAC9B,IAAI,qBAAqB,GAAmB,IAAI,CAAC;IAEjD,OAAO,GAAS,EAAE;QAChB,IAAI,QAAQ,EAAE;YACZ,OAAO,qBAAqB,CAAC;SAC9B;QAED,IAAI;YACF,qBAAqB,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAC1D,QAAQ,GAAG,IAAI,CAAC;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAC;SACpD;QAED,OAAO,qBAAqB,CAAC;IAC/B,CAAC,CAAA,CAAC;AACJ,CAAC","sourcesContent":["import type { Event, Integration, Package, SdkInfo as SdkInfoType } from '@sentry/core';\nimport { logger } from '@sentry/core';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport { SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION } from '../version';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'SdkInfo';\n\ntype DefaultSdkInfo = Pick<Required<SdkInfoType>, 'name' | 'packages' | 'version'>;\n\nexport const defaultSdkInfo: DefaultSdkInfo = {\n name: SDK_NAME,\n packages: [\n {\n name: SDK_PACKAGE_NAME,\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n};\n\n/** Default SdkInfo instrumentation */\nexport const sdkInfoIntegration = (): Integration => {\n const fetchNativeSdkInfo = createCachedFetchNativeSdkInfo();\n\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent: (event: Event) => processEvent(event, fetchNativeSdkInfo),\n };\n};\n\nasync function processEvent(event: Event, fetchNativeSdkInfo: () => Promise<Package | null>): Promise<Event> {\n const nativeSdkPackage = await fetchNativeSdkInfo();\n\n event.platform = event.platform || 'javascript';\n event.sdk = event.sdk || {};\n event.sdk.name = event.sdk.name || defaultSdkInfo.name;\n event.sdk.version = event.sdk.version || defaultSdkInfo.version;\n event.sdk.packages = [\n // default packages are added by baseclient and should not be added here\n ...(event.sdk.packages || []),\n ...((nativeSdkPackage && [nativeSdkPackage]) || []),\n ];\n\n return event;\n}\n\nfunction createCachedFetchNativeSdkInfo(): () => Promise<Package | null> {\n if (!notWeb() || isExpoGo()) {\n return () => {\n return Promise.resolve(null);\n };\n }\n\n let isCached: boolean = false;\n let nativeSdkPackageCache: Package | null = null;\n\n return async () => {\n if (isCached) {\n return nativeSdkPackageCache;\n }\n\n try {\n nativeSdkPackageCache = await NATIVE.fetchNativeSdkInfo();\n isCached = true;\n } catch (e) {\n logger.warn('Could not fetch native sdk info.', e);\n }\n\n return nativeSdkPackageCache;\n };\n}\n"]}
1
+ {"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAA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,IAAI,EAAE,CAAC;YAC7B,GAAG,CAAC,CAAC,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAC;SACpD,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;CAAA;AAED,SAAS,8BAA8B;IACrC,IAAI,CAAC,MAAM,EAAE,IAAI,QAAQ,EAAE,EAAE;QAC3B,OAAO,GAAG,EAAE;YACV,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC,CAAC;KACH;IAED,IAAI,QAAQ,GAAY,KAAK,CAAC;IAC9B,IAAI,qBAAqB,GAAmB,IAAI,CAAC;IAEjD,OAAO,GAAS,EAAE;QAChB,IAAI,QAAQ,EAAE;YACZ,OAAO,qBAAqB,CAAC;SAC9B;QAED,IAAI;YACF,qBAAqB,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAC1D,QAAQ,GAAG,IAAI,CAAC;SACjB;QAAC,OAAO,CAAC,EAAE;YACV,KAAK,CAAC,IAAI,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAC;SACnD;QAED,OAAO,qBAAqB,CAAC;IAC/B,CAAC,CAAA,CAAC;AACJ,CAAC","sourcesContent":["import type { Event, Integration, Package, SdkInfo as SdkInfoType } from '@sentry/core';\nimport { debug } from '@sentry/core';\nimport { isExpoGo, notWeb } from '../utils/environment';\nimport { SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION } from '../version';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'SdkInfo';\n\ntype DefaultSdkInfo = Pick<Required<SdkInfoType>, 'name' | 'packages' | 'version'>;\n\nexport const defaultSdkInfo: DefaultSdkInfo = {\n name: SDK_NAME,\n packages: [\n {\n name: SDK_PACKAGE_NAME,\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n};\n\n/** Default SdkInfo instrumentation */\nexport const sdkInfoIntegration = (): Integration => {\n const fetchNativeSdkInfo = createCachedFetchNativeSdkInfo();\n\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent: (event: Event) => processEvent(event, fetchNativeSdkInfo),\n };\n};\n\nasync function processEvent(event: Event, fetchNativeSdkInfo: () => Promise<Package | null>): Promise<Event> {\n const nativeSdkPackage = await fetchNativeSdkInfo();\n\n event.platform = event.platform || 'javascript';\n event.sdk = event.sdk || {};\n event.sdk.name = event.sdk.name || defaultSdkInfo.name;\n event.sdk.version = event.sdk.version || defaultSdkInfo.version;\n event.sdk.packages = [\n // default packages are added by js client and should not be added here\n ...(event.sdk.packages || []),\n ...((nativeSdkPackage && [nativeSdkPackage]) || []),\n ];\n\n return event;\n}\n\nfunction createCachedFetchNativeSdkInfo(): () => Promise<Package | null> {\n if (!notWeb() || isExpoGo()) {\n return () => {\n return Promise.resolve(null);\n };\n }\n\n let isCached: boolean = false;\n let nativeSdkPackageCache: Package | null = null;\n\n return async () => {\n if (isCached) {\n return nativeSdkPackageCache;\n }\n\n try {\n nativeSdkPackageCache = await NATIVE.fetchNativeSdkInfo();\n isCached = true;\n } catch (e) {\n debug.warn('Could not fetch native sdk info.', e);\n }\n\n return nativeSdkPackageCache;\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { logger, serializeEnvelope } from '@sentry/core';
1
+ import { debug, serializeEnvelope } from '@sentry/core';
2
2
  import { ReactNativeLibraries } from '../utils/rnlibraries';
3
3
  import { createStealthXhr, XHR_READYSTATE_DONE } from '../utils/xhr';
4
4
  /**
@@ -7,7 +7,7 @@ import { createStealthXhr, XHR_READYSTATE_DONE } from '../utils/xhr';
7
7
  * Learn more about spotlight at https://spotlightjs.com
8
8
  */
9
9
  export function spotlightIntegration({ sidecarUrl = getDefaultSidecarUrl(), } = {}) {
10
- logger.info('[Spotlight] Using Sidecar URL', sidecarUrl);
10
+ debug.log('[Spotlight] Using Sidecar URL', sidecarUrl);
11
11
  return {
12
12
  name: 'Spotlight',
13
13
  setupOnce() {
@@ -32,7 +32,7 @@ function sendEnvelopesToSidecar(client, sidecarUrl) {
32
32
  spotlightEnvelope[1] = envelopeItems;
33
33
  const xhr = createStealthXhr();
34
34
  if (!xhr) {
35
- logger.error('[Spotlight] Sentry SDK can not create XHR object');
35
+ debug.error('[Spotlight] Sentry SDK can not create XHR object');
36
36
  return;
37
37
  }
38
38
  xhr.open('POST', sidecarUrl, true);
@@ -45,7 +45,7 @@ function sendEnvelopesToSidecar(client, sidecarUrl) {
45
45
  }
46
46
  else {
47
47
  // Handle the error
48
- logger.error("[Spotlight] Sentry SDK can't connect to Spotlight is it running? See https://spotlightjs.com to download it.", new Error(xhr.statusText));
48
+ debug.error("[Spotlight] Sentry SDK can't connect to Spotlight is it running? See https://spotlightjs.com to download it.", new Error(xhr.statusText));
49
49
  }
50
50
  }
51
51
  };
@@ -1 +1 @@
1
- {"version":3,"file":"spotlight.js","sourceRoot":"","sources":["../../../src/js/integrations/spotlight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAYrE;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,UAAU,GAAG,oBAAoB,EAAE,MACO,EAAE;IAC5C,MAAM,CAAC,IAAI,CAAC,+BAA+B,EAAE,UAAU,CAAC,CAAC;IAEzD,OAAO;QACL,IAAI,EAAE,WAAW;QAEjB,SAAS;YACP,qBAAqB;QACvB,CAAC;QAED,KAAK,CAAC,MAAmD;YACvD,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,MAAc,EAAE,UAAkB;IAC/C,sBAAsB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,sBAA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,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,mBAAmB,GAAG,8BAA8B,CAAC;AAE3D;;GAEG;AACH,MAAM,UAAU,oBAAoB;;IAClC,IAAI;QACF,MAAM,EAAE,GAAG,EAAE,GAAG,MAAA,MAAA,oBAAoB,CAAC,QAAQ,0CAAE,YAAY,EAAE,mCAAI,EAAE,CAAC;QACpE,IAAI,CAAC,GAAG,EAAE;YACR,OAAO,mBAAmB,CAAC;SAC5B;QAED,OAAO,UAAU,qBAAqB,CAAC,GAAG,CAAC,cAAc,CAAC;KAC3D;IAAC,OAAO,GAAG,EAAE;QACZ,8BAA8B;KAC/B;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAAC,SAAiB;IAC9C,MAAM,KAAK,GAAG,oCAAoC,CAAC;IACnD,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEvC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,CAAC,CAAC,EAAE;QAChB,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;KACnB;SAAM;QACL,qBAAqB;QACrB,OAAO,IAAI,CAAC;KACb;AACH,CAAC","sourcesContent":["import type { BaseTransportOptions, Client, ClientOptions, Envelope, Integration } from '@sentry/core';\nimport { logger, serializeEnvelope } from '@sentry/core';\nimport { ReactNativeLibraries } from '../utils/rnlibraries';\nimport { createStealthXhr, XHR_READYSTATE_DONE } from '../utils/xhr';\n\ntype SpotlightReactNativeIntegrationOptions = {\n /**\n * The URL of the Sidecar instance to connect and forward events to.\n * If not set, Spotlight will try to connect to the Sidecar running on localhost:8969.\n *\n * @default \"http://localhost:8969/stream\"\n */\n sidecarUrl?: string;\n};\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n */\nexport function spotlightIntegration({\n sidecarUrl = getDefaultSidecarUrl(),\n}: SpotlightReactNativeIntegrationOptions = {}): Integration {\n logger.info('[Spotlight] Using Sidecar URL', sidecarUrl);\n\n return {\n name: 'Spotlight',\n\n setupOnce(): void {\n // nothing to do here\n },\n\n setup(client: Client<ClientOptions<BaseTransportOptions>>): void {\n setup(client, sidecarUrl);\n },\n };\n}\n\nfunction setup(client: Client, sidecarUrl: string): void {\n sendEnvelopesToSidecar(client, sidecarUrl);\n}\n\nfunction sendEnvelopesToSidecar(client: Client, sidecarUrl: string): void {\n if (!client.on) {\n return;\n }\n\n client.on('beforeEnvelope', (originalEnvelope: Envelope) => {\n // TODO: This is a workaround for spotlight/sidecar not supporting images\n const spotlightEnvelope: Envelope = [...originalEnvelope];\n const envelopeItems = [...originalEnvelope[1]].filter(\n item => typeof item[0].content_type !== 'string' || !item[0].content_type.startsWith('image'),\n );\n\n spotlightEnvelope[1] = envelopeItems as Envelope[1];\n\n const xhr = createStealthXhr();\n if (!xhr) {\n logger.error('[Spotlight] Sentry SDK can not create XHR object');\n return;\n }\n\n xhr.open('POST', sidecarUrl, true);\n xhr.setRequestHeader('Content-Type', 'application/x-sentry-envelope');\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n const status = xhr.status;\n if (status === 0 || (status >= 200 && status < 400)) {\n // The request has been completed successfully\n } else {\n // Handle the error\n logger.error(\n \"[Spotlight] Sentry SDK can't connect to Spotlight is it running? See https://spotlightjs.com to download it.\",\n new Error(xhr.statusText),\n );\n }\n }\n };\n\n xhr.send(serializeEnvelope(spotlightEnvelope));\n });\n}\n\nconst DEFAULT_SIDECAR_URL = 'http://localhost:8969/stream';\n\n/**\n * Gets the default Spotlight sidecar URL.\n */\nexport function getDefaultSidecarUrl(): string {\n try {\n const { url } = ReactNativeLibraries.Devtools?.getDevServer() ?? {};\n if (!url) {\n return DEFAULT_SIDECAR_URL;\n }\n\n return `http://${getHostnameFromString(url)}:8969/stream`;\n } catch (_oO) {\n // We can't load devserver URL\n }\n return DEFAULT_SIDECAR_URL;\n}\n\n/**\n * React Native implementation of the URL class is missing the `hostname` property.\n */\nfunction getHostnameFromString(urlString: string): string | null {\n const regex = /^(?:\\w+:)?\\/\\/([^/:]+)(:\\d+)?(.*)$/;\n const matches = urlString.match(regex);\n\n if (matches?.[1]) {\n return matches[1];\n } else {\n // Invalid URL format\n return null;\n }\n}\n"]}
1
+ {"version":3,"file":"spotlight.js","sourceRoot":"","sources":["../../../src/js/integrations/spotlight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAYrE;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,UAAU,GAAG,oBAAoB,EAAE,MACO,EAAE;IAC5C,KAAK,CAAC,GAAG,CAAC,+BAA+B,EAAE,UAAU,CAAC,CAAC;IAEvD,OAAO;QACL,IAAI,EAAE,WAAW;QAEjB,SAAS;YACP,qBAAqB;QACvB,CAAC;QAED,KAAK,CAAC,MAAmD;YACvD,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,MAAc,EAAE,UAAkB;IAC/C,sBAAsB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,sBAAsB,CAAC,MAAc,EAAE,UAAkB;IAChE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;QACd,OAAO;KACR;IAED,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,CAAC,gBAA0B,EAAE,EAAE;QACzD,yEAAyE;QACzE,MAAM,iBAAiB,GAAa,CAAC,GAAG,gBAAgB,CAAC,CAAC;QAC1D,M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A,oBAAoB,CAAC,QAAQ,0CAAE,YAAY,EAAE,mCAAI,EAAE,CAAC;QACpE,IAAI,CAAC,GAAG,EAAE;YACR,OAAO,mBAAmB,CAAC;SAC5B;QAED,OAAO,UAAU,qBAAqB,CAAC,GAAG,CAAC,cAAc,CAAC;KAC3D;IAAC,OAAO,GAAG,EAAE;QACZ,8BAA8B;KAC/B;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAAC,SAAiB;IAC9C,MAAM,KAAK,GAAG,oCAAoC,CAAC;IACnD,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEvC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,CAAC,CAAC,EAAE;QAChB,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;KACnB;SAAM;QACL,qBAAqB;QACrB,OAAO,IAAI,CAAC;KACb;AACH,CAAC","sourcesContent":["import type { BaseTransportOptions, Client, ClientOptions, Envelope, Integration } from '@sentry/core';\nimport { debug, serializeEnvelope } from '@sentry/core';\nimport { ReactNativeLibraries } from '../utils/rnlibraries';\nimport { createStealthXhr, XHR_READYSTATE_DONE } from '../utils/xhr';\n\ntype SpotlightReactNativeIntegrationOptions = {\n /**\n * The URL of the Sidecar instance to connect and forward events to.\n * If not set, Spotlight will try to connect to the Sidecar running on localhost:8969.\n *\n * @default \"http://localhost:8969/stream\"\n */\n sidecarUrl?: string;\n};\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n */\nexport function spotlightIntegration({\n sidecarUrl = getDefaultSidecarUrl(),\n}: SpotlightReactNativeIntegrationOptions = {}): Integration {\n debug.log('[Spotlight] Using Sidecar URL', sidecarUrl);\n\n return {\n name: 'Spotlight',\n\n setupOnce(): void {\n // nothing to do here\n },\n\n setup(client: Client<ClientOptions<BaseTransportOptions>>): void {\n setup(client, sidecarUrl);\n },\n };\n}\n\nfunction setup(client: Client, sidecarUrl: string): void {\n sendEnvelopesToSidecar(client, sidecarUrl);\n}\n\nfunction sendEnvelopesToSidecar(client: Client, sidecarUrl: string): void {\n if (!client.on) {\n return;\n }\n\n client.on('beforeEnvelope', (originalEnvelope: Envelope) => {\n // TODO: This is a workaround for spotlight/sidecar not supporting images\n const spotlightEnvelope: Envelope = [...originalEnvelope];\n const envelopeItems = [...originalEnvelope[1]].filter(\n item => typeof item[0].content_type !== 'string' || !item[0].content_type.startsWith('image'),\n );\n\n spotlightEnvelope[1] = envelopeItems as Envelope[1];\n\n const xhr = createStealthXhr();\n if (!xhr) {\n debug.error('[Spotlight] Sentry SDK can not create XHR object');\n return;\n }\n\n xhr.open('POST', sidecarUrl, true);\n xhr.setRequestHeader('Content-Type', 'application/x-sentry-envelope');\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n const status = xhr.status;\n if (status === 0 || (status >= 200 && status < 400)) {\n // The request has been completed successfully\n } else {\n // Handle the error\n debug.error(\n \"[Spotlight] Sentry SDK can't connect to Spotlight is it running? See https://spotlightjs.com to download it.\",\n new Error(xhr.statusText),\n );\n }\n }\n };\n\n xhr.send(serializeEnvelope(spotlightEnvelope));\n });\n}\n\nconst DEFAULT_SIDECAR_URL = 'http://localhost:8969/stream';\n\n/**\n * Gets the default Spotlight sidecar URL.\n */\nexport function getDefaultSidecarUrl(): string {\n try {\n const { url } = ReactNativeLibraries.Devtools?.getDevServer() ?? {};\n if (!url) {\n return DEFAULT_SIDECAR_URL;\n }\n\n return `http://${getHostnameFromString(url)}:8969/stream`;\n } catch (_oO) {\n // We can't load devserver URL\n }\n return DEFAULT_SIDECAR_URL;\n}\n\n/**\n * React Native implementation of the URL class is missing the `hostname` property.\n */\nfunction getHostnameFromString(urlString: string): string | null {\n const regex = /^(?:\\w+:)?\\/\\/([^/:]+)(:\\d+)?(.*)$/;\n const matches = urlString.match(regex);\n\n if (matches?.[1]) {\n return matches[1];\n } else {\n // Invalid URL format\n return null;\n }\n}\n"]}
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { logger } from '@sentry/core';
10
+ import { debug } from '@sentry/core';
11
11
  import { NATIVE } from '../wrapper';
12
12
  const filename = 'view-hierarchy.json';
13
13
  const contentType = 'application/json';
@@ -35,7 +35,7 @@ function processEvent(event, hint) {
35
35
  viewHierarchy = yield NATIVE.fetchViewHierarchy();
36
36
  }
37
37
  catch (e) {
38
- logger.error('Failed to get view hierarchy from native.', e);
38
+ debug.error('Failed to get view hierarchy from native.', e);
39
39
  }
40
40
  if (viewHierarchy) {
41
41
  hint.attachments = [
@@ -1 +1 @@
1
- {"version":3,"file":"viewhierarchy.js","sourceRoot":"","sources":["../../../src/js/integrations/viewhierarchy.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,QAAQ,GAAW,qBAAqB,CAAC;AAC/C,MAAM,WAAW,GAAW,kBAAkB,CAAC;AAC/C,MAAM,cAAc,GAAG,sBAAsD,CAAC;AAE9E,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,yCAAyC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAgB,EAAE;IACxD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF,SAAe,YAAY,CAAC,KAAY,EAAE,IAAe;;;QACvD,MAAM,YAAY,GAAG,CAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,KAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAClF,IAAI,CAAC,YAAY,EAAE;YACjB,OAAO,KAAK,CAAC;SACd;QAED,IAAI,aAAa,GAAsB,IAAI,CAAC;QAC5C,IAAI;YACF,aAAa,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;SACnD;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,CAAC,CAAC,CAAC;SAC9D;QAED,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,WAAW,GAAG;gBACjB;oBACE,QAAQ;oBACR,WAAW;oBACX,cAAc;oBACd,IAAI,EAAE,aAAa;iBACpB;gBACD,GAAG,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,KAAI,EAAE,CAAC;aAC7B,CAAC;SACH;QAED,OAAO,KAAK,CAAC;;CACd","sourcesContent":["import type { Attachment, Event, EventHint, Integration } from '@sentry/core';\nimport { logger } from '@sentry/core';\nimport { NATIVE } from '../wrapper';\n\nconst filename: string = 'view-hierarchy.json';\nconst contentType: string = 'application/json';\nconst attachmentType = 'event.view_hierarchy' as Attachment['attachmentType'];\n\nconst INTEGRATION_NAME = 'ViewHierarchy';\n\n/** Adds ViewHierarchy to error events */\nexport const viewHierarchyIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent,\n };\n};\n\nasync function processEvent(event: Event, hint: EventHint): Promise<Event> {\n const hasException = event.exception?.values && event.exception.values.length > 0;\n if (!hasException) {\n return event;\n }\n\n let viewHierarchy: Uint8Array | null = null;\n try {\n viewHierarchy = await NATIVE.fetchViewHierarchy();\n } catch (e) {\n logger.error('Failed to get view hierarchy from native.', e);\n }\n\n if (viewHierarchy) {\n hint.attachments = [\n {\n filename,\n contentType,\n attachmentType,\n data: viewHierarchy,\n },\n ...(hint?.attachments || []),\n ];\n }\n\n return event;\n}\n"]}
1
+ {"version":3,"file":"viewhierarchy.js","sourceRoot":"","sources":["../../../src/js/integrations/viewhierarchy.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,QAAQ,GAAW,qBAAqB,CAAC;AAC/C,MAAM,WAAW,GAAW,kBAAkB,CAAC;AAC/C,MAAM,cAAc,GAAG,sBAAsD,CAAC;AAE9E,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,yCAAyC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAgB,EAAE;IACxD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF,SAAe,YAAY,CAAC,KAAY,EAAE,IAAe;;;QACvD,MAAM,YAAY,GAAG,CAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,KAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAClF,IAAI,CAAC,YAAY,EAAE;YACjB,OAAO,KAAK,CAAC;SACd;QAED,IAAI,aAAa,GAAsB,IAAI,CAAC;QAC5C,IAAI;YACF,aAAa,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;SACnD;QAAC,OAAO,CAAC,EAAE;YACV,KAAK,CAAC,KAAK,CAAC,2CAA2C,EAAE,CAAC,CAAC,CAAC;SAC7D;QAED,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,WAAW,GAAG;gBACjB;oBACE,QAAQ;oBACR,WAAW;oBACX,cAAc;oBACd,IAAI,EAAE,aAAa;iBACpB;gBACD,GAAG,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,KAAI,EAAE,CAAC;aAC7B,CAAC;SACH;QAED,OAAO,KAAK,CAAC;;CACd","sourcesContent":["import type { Attachment, Event, EventHint, Integration } from '@sentry/core';\nimport { debug } from '@sentry/core';\nimport { NATIVE } from '../wrapper';\n\nconst filename: string = 'view-hierarchy.json';\nconst contentType: string = 'application/json';\nconst attachmentType = 'event.view_hierarchy' as Attachment['attachmentType'];\n\nconst INTEGRATION_NAME = 'ViewHierarchy';\n\n/** Adds ViewHierarchy to error events */\nexport const viewHierarchyIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent,\n };\n};\n\nasync function processEvent(event: Event, hint: EventHint): Promise<Event> {\n const hasException = event.exception?.values && event.exception.values.length > 0;\n if (!hasException) {\n return event;\n }\n\n let viewHierarchy: Uint8Array | null = null;\n try {\n viewHierarchy = await NATIVE.fetchViewHierarchy();\n } catch (e) {\n debug.error('Failed to get view hierarchy from native.', e);\n }\n\n if (viewHierarchy) {\n hint.attachments = [\n {\n filename,\n contentType,\n attachmentType,\n data: viewHierarchy,\n },\n ...(hint?.attachments || []),\n ];\n }\n\n return event;\n}\n"]}
@@ -207,6 +207,13 @@ export interface BaseReactNativeOptions {
207
207
  * problems.
208
208
  */
209
209
  shutdownTimeout?: number;
210
+ /**
211
+ * Defines the quality of the session replay. The higher the quality, the more accurate the replay
212
+ * will be, but also more data to transfer and more CPU load.
213
+ *
214
+ * @default 'medium'
215
+ */
216
+ replaysSessionQuality?: SentryReplayQuality;
210
217
  /**
211
218
  * Options which are in beta, or otherwise not guaranteed to be stable.
212
219
  */
@@ -243,6 +250,7 @@ export interface BaseReactNativeOptions {
243
250
  */
244
251
  useThreadsForMessageStack?: boolean;
245
252
  }
253
+ export type SentryReplayQuality = 'low' | 'medium' | 'high';
246
254
  export interface ReactNativeTransportOptions extends BrowserTransportOptions {
247
255
  /**
248
256
  * @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;AAC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