@sentry/react-native 8.4.0 → 8.6.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 (266) hide show
  1. package/RNSentry.podspec +1 -1
  2. package/android/build.gradle +2 -2
  3. package/android/expo-handler/build.gradle +20 -0
  4. package/android/expo-handler/src/main/java/io/sentry/react/expo/SentryExpoPackage.java +22 -0
  5. package/android/expo-handler/src/main/java/io/sentry/react/expo/SentryReactNativeHostHandler.java +48 -0
  6. package/android/expo-stubs/README.md +7 -0
  7. package/android/expo-stubs/build.gradle +23 -0
  8. package/android/expo-stubs/gradle/wrapper/gradle-wrapper.jar +0 -0
  9. package/android/expo-stubs/gradle/wrapper/gradle-wrapper.properties +7 -0
  10. package/android/expo-stubs/gradlew +251 -0
  11. package/android/expo-stubs/gradlew.bat +94 -0
  12. package/android/expo-stubs/settings.gradle +1 -0
  13. package/android/expo-stubs/src/main/java/expo/modules/core/interfaces/Package.java +11 -0
  14. package/android/expo-stubs/src/main/java/expo/modules/core/interfaces/ReactNativeHostHandler.java +7 -0
  15. package/android/libs/expo-stubs.jar +0 -0
  16. package/android/libs/replay-stubs.jar +0 -0
  17. package/android/replay-stubs/build.gradle +1 -1
  18. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +71 -15
  19. package/android/src/main/java/io/sentry/react/RNSentryStart.java +3 -0
  20. package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
  21. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +10 -0
  22. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +10 -0
  23. package/dist/js/NativeLogListener.js.map +1 -1
  24. package/dist/js/NativeRNSentry.d.ts +2 -0
  25. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  26. package/dist/js/NativeRNSentry.js.map +1 -1
  27. package/dist/js/RNSentryReplayMaskNativeComponent.d.ts.map +1 -1
  28. package/dist/js/RNSentryReplayUnmaskNativeComponent.d.ts.map +1 -1
  29. package/dist/js/breadcrumb.js.map +1 -1
  30. package/dist/js/client.js.map +1 -1
  31. package/dist/js/feedback/FeedbackButton.js.map +1 -1
  32. package/dist/js/feedback/FeedbackWidget.js +6 -6
  33. package/dist/js/feedback/FeedbackWidget.js.map +1 -1
  34. package/dist/js/feedback/FeedbackWidget.styles.d.ts.map +1 -1
  35. package/dist/js/feedback/FeedbackWidgetManager.d.ts +3 -1
  36. package/dist/js/feedback/FeedbackWidgetManager.d.ts.map +1 -1
  37. package/dist/js/feedback/FeedbackWidgetManager.js +15 -1
  38. package/dist/js/feedback/FeedbackWidgetManager.js.map +1 -1
  39. package/dist/js/feedback/FeedbackWidgetProvider.d.ts +3 -2
  40. package/dist/js/feedback/FeedbackWidgetProvider.d.ts.map +1 -1
  41. package/dist/js/feedback/FeedbackWidgetProvider.js +12 -4
  42. package/dist/js/feedback/FeedbackWidgetProvider.js.map +1 -1
  43. package/dist/js/feedback/ScreenshotButton.d.ts +1 -1
  44. package/dist/js/feedback/ScreenshotButton.js.map +1 -1
  45. package/dist/js/feedback/ShakeToReportBug.d.ts +27 -0
  46. package/dist/js/feedback/ShakeToReportBug.d.ts.map +1 -0
  47. package/dist/js/feedback/ShakeToReportBug.js +83 -0
  48. package/dist/js/feedback/ShakeToReportBug.js.map +1 -0
  49. package/dist/js/feedback/defaults.js.map +1 -1
  50. package/dist/js/feedback/integration.d.ts +13 -2
  51. package/dist/js/feedback/integration.d.ts.map +1 -1
  52. package/dist/js/feedback/integration.js +7 -1
  53. package/dist/js/feedback/integration.js.map +1 -1
  54. package/dist/js/feedback/lazy.js.map +1 -1
  55. package/dist/js/feedback/utils.d.ts.map +1 -1
  56. package/dist/js/feedback/utils.js.map +1 -1
  57. package/dist/js/index.d.ts +1 -1
  58. package/dist/js/index.d.ts.map +1 -1
  59. package/dist/js/index.js +1 -1
  60. package/dist/js/index.js.map +1 -1
  61. package/dist/js/integrations/appRegistry.d.ts.map +1 -1
  62. package/dist/js/integrations/appRegistry.js.map +1 -1
  63. package/dist/js/integrations/breadcrumbs.d.ts.map +1 -1
  64. package/dist/js/integrations/debugsymbolicator.js +6 -4
  65. package/dist/js/integrations/debugsymbolicator.js.map +1 -1
  66. package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
  67. package/dist/js/integrations/default.d.ts.map +1 -1
  68. package/dist/js/integrations/default.js +3 -2
  69. package/dist/js/integrations/default.js.map +1 -1
  70. package/dist/js/integrations/devicecontext.js +1 -1
  71. package/dist/js/integrations/devicecontext.js.map +1 -1
  72. package/dist/js/integrations/expoconstants.js.map +1 -1
  73. package/dist/js/integrations/expocontext.js.map +1 -1
  74. package/dist/js/integrations/exports.d.ts +1 -0
  75. package/dist/js/integrations/exports.d.ts.map +1 -1
  76. package/dist/js/integrations/exports.js +1 -0
  77. package/dist/js/integrations/exports.js.map +1 -1
  78. package/dist/js/integrations/expoupdateslistener.d.ts +38 -0
  79. package/dist/js/integrations/expoupdateslistener.d.ts.map +1 -0
  80. package/dist/js/integrations/expoupdateslistener.js +130 -0
  81. package/dist/js/integrations/expoupdateslistener.js.map +1 -0
  82. package/dist/js/integrations/logEnricherIntegration.js +1 -1
  83. package/dist/js/integrations/logEnricherIntegration.js.map +1 -1
  84. package/dist/js/integrations/modulesloader.js.map +1 -1
  85. package/dist/js/integrations/nativelinkederrors.d.ts.map +1 -1
  86. package/dist/js/integrations/nativelinkederrors.js +1 -0
  87. package/dist/js/integrations/nativelinkederrors.js.map +1 -1
  88. package/dist/js/integrations/primitiveTagIntegration.js.map +1 -1
  89. package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
  90. package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
  91. package/dist/js/integrations/reactnativeerrorhandlersutils.js.map +1 -1
  92. package/dist/js/integrations/reactnativeinfo.js.map +1 -1
  93. package/dist/js/integrations/release.js +1 -1
  94. package/dist/js/integrations/release.js.map +1 -1
  95. package/dist/js/integrations/rewriteframes.js.map +1 -1
  96. package/dist/js/integrations/screenshot.js +1 -1
  97. package/dist/js/integrations/screenshot.js.map +1 -1
  98. package/dist/js/integrations/sdkinfo.js.map +1 -1
  99. package/dist/js/integrations/spotlight.js.map +1 -1
  100. package/dist/js/integrations/viewhierarchy.js +1 -1
  101. package/dist/js/integrations/viewhierarchy.js.map +1 -1
  102. package/dist/js/misc.js +2 -2
  103. package/dist/js/misc.js.map +1 -1
  104. package/dist/js/options.d.ts +13 -1
  105. package/dist/js/options.d.ts.map +1 -1
  106. package/dist/js/options.js.map +1 -1
  107. package/dist/js/playground/examples.js.map +1 -1
  108. package/dist/js/playground/modal.d.ts +2 -2
  109. package/dist/js/playground/modal.d.ts.map +1 -1
  110. package/dist/js/playground/modal.js +6 -6
  111. package/dist/js/playground/modal.js.map +1 -1
  112. package/dist/js/profiling/cache.js.map +1 -1
  113. package/dist/js/profiling/convertHermesProfile.js.map +1 -1
  114. package/dist/js/profiling/debugid.js.map +1 -1
  115. package/dist/js/profiling/integration.d.ts.map +1 -1
  116. package/dist/js/profiling/integration.js.map +1 -1
  117. package/dist/js/profiling/utils.js.map +1 -1
  118. package/dist/js/replay/CustomMask.d.ts.map +1 -1
  119. package/dist/js/replay/CustomMask.js.map +1 -1
  120. package/dist/js/replay/CustomMask.web.d.ts.map +1 -1
  121. package/dist/js/replay/browserReplay.d.ts.map +1 -1
  122. package/dist/js/replay/browserReplay.js.map +1 -1
  123. package/dist/js/replay/mobilereplay.d.ts.map +1 -1
  124. package/dist/js/replay/mobilereplay.js +21 -2
  125. package/dist/js/replay/mobilereplay.js.map +1 -1
  126. package/dist/js/replay/networkUtils.d.ts +0 -1
  127. package/dist/js/replay/networkUtils.d.ts.map +1 -1
  128. package/dist/js/replay/networkUtils.js.map +1 -1
  129. package/dist/js/replay/xhrUtils.js.map +1 -1
  130. package/dist/js/scopeSync.js.map +1 -1
  131. package/dist/js/sdk.d.ts.map +1 -1
  132. package/dist/js/sdk.js +4 -2
  133. package/dist/js/sdk.js.map +1 -1
  134. package/dist/js/tools/ModulesCollector.js.map +1 -1
  135. package/dist/js/tools/easBuildHooks.js +13 -14
  136. package/dist/js/tools/easBuildHooks.js.map +1 -1
  137. package/dist/js/tools/enableLogger.js +1 -2
  138. package/dist/js/tools/enableLogger.js.map +1 -1
  139. package/dist/js/tools/metroMiddleware.d.ts.map +1 -1
  140. package/dist/js/tools/metroMiddleware.js.map +1 -1
  141. package/dist/js/tools/metroconfig.js +6 -7
  142. package/dist/js/tools/metroconfig.js.map +1 -1
  143. package/dist/js/tools/sentryBabelTransformerUtils.js +7 -7
  144. package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -1
  145. package/dist/js/tools/sentryMetroSerializer.d.ts.map +1 -1
  146. package/dist/js/tools/sentryMetroSerializer.js +2 -2
  147. package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
  148. package/dist/js/tools/sentryOptionsSerializer.js +1 -2
  149. package/dist/js/tools/sentryOptionsSerializer.js.map +1 -1
  150. package/dist/js/tools/sentryReleaseInjector.d.ts +1 -1
  151. package/dist/js/tools/sentryReleaseInjector.d.ts.map +1 -1
  152. package/dist/js/tools/sentryReleaseInjector.js.map +1 -1
  153. package/dist/js/tools/utils.d.ts.map +1 -1
  154. package/dist/js/tools/utils.js +9 -10
  155. package/dist/js/tools/utils.js.map +1 -1
  156. package/dist/js/tools/vendor/metro/countLines.d.ts.map +1 -1
  157. package/dist/js/tools/vendor/metro/utils.d.ts.map +1 -1
  158. package/dist/js/tools/vendor/metro/utils.js.map +1 -1
  159. package/dist/js/touchevents.d.ts.map +1 -1
  160. package/dist/js/touchevents.js +2 -0
  161. package/dist/js/touchevents.js.map +1 -1
  162. package/dist/js/tracing/expoAsset.js.map +1 -1
  163. package/dist/js/tracing/expoImage.js.map +1 -1
  164. package/dist/js/tracing/expoRouter.js.map +1 -1
  165. package/dist/js/tracing/gesturetracing.js.map +1 -1
  166. package/dist/js/tracing/integrations/appStart.d.ts +9 -1
  167. package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
  168. package/dist/js/tracing/integrations/appStart.js +61 -12
  169. package/dist/js/tracing/integrations/appStart.js.map +1 -1
  170. package/dist/js/tracing/integrations/nativeFrames.d.ts.map +1 -1
  171. package/dist/js/tracing/integrations/nativeFrames.js +35 -22
  172. package/dist/js/tracing/integrations/nativeFrames.js.map +1 -1
  173. package/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
  174. package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -1
  175. package/dist/js/tracing/integrations/stalltracking.js +4 -1
  176. package/dist/js/tracing/integrations/stalltracking.js.map +1 -1
  177. package/dist/js/tracing/integrations/timeToDisplayIntegration.d.ts.map +1 -1
  178. package/dist/js/tracing/integrations/timeToDisplayIntegration.js +15 -14
  179. package/dist/js/tracing/integrations/timeToDisplayIntegration.js.map +1 -1
  180. package/dist/js/tracing/integrations/userInteraction.d.ts.map +1 -1
  181. package/dist/js/tracing/integrations/userInteraction.js.map +1 -1
  182. package/dist/js/tracing/onSpanEndUtils.d.ts.map +1 -1
  183. package/dist/js/tracing/onSpanEndUtils.js +20 -13
  184. package/dist/js/tracing/onSpanEndUtils.js.map +1 -1
  185. package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
  186. package/dist/js/tracing/reactnativenavigation.js +1 -1
  187. package/dist/js/tracing/reactnativenavigation.js.map +1 -1
  188. package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
  189. package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
  190. package/dist/js/tracing/reactnativetracing.js.map +1 -1
  191. package/dist/js/tracing/reactnavigation.d.ts +3 -0
  192. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  193. package/dist/js/tracing/reactnavigation.js +7 -3
  194. package/dist/js/tracing/reactnavigation.js.map +1 -1
  195. package/dist/js/tracing/span.d.ts +2 -17
  196. package/dist/js/tracing/span.d.ts.map +1 -1
  197. package/dist/js/tracing/span.js.map +1 -1
  198. package/dist/js/tracing/timeToDisplayFallback.d.ts.map +1 -1
  199. package/dist/js/tracing/timetodisplay.js.map +1 -1
  200. package/dist/js/tracing/timetodisplaynative.d.ts.map +1 -1
  201. package/dist/js/tracing/timetodisplaynative.js.map +1 -1
  202. package/dist/js/tracing/utils.js.map +1 -1
  203. package/dist/js/transports/encodePolyfill.d.ts +1 -1
  204. package/dist/js/transports/encodePolyfill.d.ts.map +1 -1
  205. package/dist/js/transports/encodePolyfill.js.map +1 -1
  206. package/dist/js/transports/native.js.map +1 -1
  207. package/dist/js/utils/AsyncExpiringMap.js.map +1 -1
  208. package/dist/js/utils/encode.js.map +1 -1
  209. package/dist/js/utils/environment.js.map +1 -1
  210. package/dist/js/utils/ignorerequirecyclelogs.js +1 -1
  211. package/dist/js/utils/ignorerequirecyclelogs.js.map +1 -1
  212. package/dist/js/utils/normalize.js.map +1 -1
  213. package/dist/js/utils/outcome.js.map +1 -1
  214. package/dist/js/utils/primitiveConverter.js.map +1 -1
  215. package/dist/js/utils/release.js.map +1 -1
  216. package/dist/js/utils/rnlibraries.js.map +1 -1
  217. package/dist/js/utils/safe.d.ts +1 -1
  218. package/dist/js/utils/safe.d.ts.map +1 -1
  219. package/dist/js/utils/safe.js.map +1 -1
  220. package/dist/js/utils/worldwide.d.ts +0 -1
  221. package/dist/js/utils/worldwide.d.ts.map +1 -1
  222. package/dist/js/utils/xhr.d.ts +0 -1
  223. package/dist/js/utils/xhr.d.ts.map +1 -1
  224. package/dist/js/utils/xhr.js.map +1 -1
  225. package/dist/js/vendor/base64-js/fromByteArray.js.map +1 -1
  226. package/dist/js/vendor/buffer/utf8ToBytes.js.map +1 -1
  227. package/dist/js/version.d.ts +1 -1
  228. package/dist/js/version.js +1 -1
  229. package/dist/js/version.js.map +1 -1
  230. package/dist/js/wrapper.d.ts.map +1 -1
  231. package/dist/js/wrapper.js +5 -6
  232. package/dist/js/wrapper.js.map +1 -1
  233. package/expo-module.config.json +7 -0
  234. package/ios/RNSentry.mm +47 -1
  235. package/ios/RNSentryEvents.h +1 -0
  236. package/ios/RNSentryEvents.m +1 -0
  237. package/ios/RNSentryStart.m +4 -1
  238. package/ios/RNSentryVersion.m +1 -1
  239. package/package.json +15 -15
  240. package/plugin/build/withSentry.js +1 -1
  241. package/plugin/build/withSentryAndroidGradlePlugin.d.ts +1 -1
  242. package/plugin/build/withSentryAndroidGradlePlugin.js +1 -1
  243. package/scripts/sentry-xcode.sh +14 -0
  244. package/sentry.gradle +13 -0
  245. package/src/js/NativeRNSentry.ts +2 -0
  246. package/ts3.8/dist/js/NativeRNSentry.d.ts +2 -0
  247. package/ts3.8/dist/js/feedback/FeedbackWidgetManager.d.ts +3 -1
  248. package/ts3.8/dist/js/feedback/FeedbackWidgetProvider.d.ts +3 -2
  249. package/ts3.8/dist/js/feedback/ScreenshotButton.d.ts +1 -1
  250. package/ts3.8/dist/js/feedback/ShakeToReportBug.d.ts +27 -0
  251. package/ts3.8/dist/js/feedback/integration.d.ts +13 -2
  252. package/ts3.8/dist/js/index.d.ts +1 -1
  253. package/ts3.8/dist/js/integrations/exports.d.ts +1 -0
  254. package/ts3.8/dist/js/integrations/expoupdateslistener.d.ts +38 -0
  255. package/ts3.8/dist/js/options.d.ts +13 -1
  256. package/ts3.8/dist/js/playground/modal.d.ts +2 -2
  257. package/ts3.8/dist/js/replay/networkUtils.d.ts +0 -1
  258. package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +9 -1
  259. package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
  260. package/ts3.8/dist/js/tracing/reactnavigation.d.ts +3 -0
  261. package/ts3.8/dist/js/tracing/span.d.ts +2 -17
  262. package/ts3.8/dist/js/transports/encodePolyfill.d.ts +1 -1
  263. package/ts3.8/dist/js/utils/safe.d.ts +1 -1
  264. package/ts3.8/dist/js/utils/worldwide.d.ts +0 -1
  265. package/ts3.8/dist/js/utils/xhr.d.ts +0 -1
  266. package/ts3.8/dist/js/version.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"debugsymbolicator.js","sourceRoot":"","sources":["../../../src/js/integrations/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A0B;IACrG,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,EAAE;QACzB,SAAS,CAAC,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;KAChD;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,0BAA0B,CAAC,KAAY,EAAE,MAA0B;;IAC1E,IAAI,MAAA,MAAA,MAAA,KAAK,CAAC,OAAO,0CAAE,MAAM,0CAAG,CAAC,CAAC,0CAAE,UAAU,EAAE;QAC1C,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;KAC9D;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,iBAA0B;IACnD,MAAM,GAAG,GAAG,iBAAkC,CAAC;IAC/C,MAAM,UAAU,GAAkC,EAAE,CAAC;IACrD,KAAK,IAAI,KAAK,GAA8B,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE;QACxF,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACxB;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type { Event, EventHint, Exception, Integration, StackFrame as SentryStackFrame } from '@sentry/core';\nimport { debug } from '@sentry/core';\nimport type { ExtendedError } from '../utils/error';\nimport { getFramesToPop, isErrorLike } from '../utils/error';\nimport type * as ReactNative from '../vendor/react-native';\nimport { fetchSourceContext, parseErrorStack, symbolicateStackTrace } from './debugsymbolicatorutils';\n\nconst INTEGRATION_NAME = 'DebugSymbolicator';\n\n// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\nconst INTERNAL_CALLSITES_REGEX = new RegExp(['ReactNativeRenderer-dev\\\\.js$', 'MessageQueue\\\\.js$'].join('|'));\n\n/**\n * React Native Error\n */\nexport type ReactNativeError = Error & {\n framesToPop?: number;\n jsEngine?: string;\n preventSymbolication?: boolean;\n componentStack?: string;\n};\n\n/** Tries to symbolicate the JS stack trace on the device. */\nexport const debugSymbolicatorIntegration = (): 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 if (event.exception?.values && isErrorLike(hint.originalException)) {\n // originalException is ErrorLike object\n const errorGroup = getExceptionGroup(hint.originalException);\n for (const [index, error] of errorGroup.entries()) {\n const symbolicatedFrames = await symbolicate(error.stack, getFramesToPop(error));\n\n symbolicatedFrames && replaceExceptionFramesInException(event.exception.values[index], symbolicatedFrames);\n }\n } else if (hint.syntheticException && isErrorLike(hint.syntheticException)) {\n // syntheticException is Error object\n const symbolicatedFrames = await symbolicate(\n hint.syntheticException.stack,\n getFramesToPop(hint.syntheticException),\n );\n\n if (event.exception) {\n symbolicatedFrames &&\n event.exception.values &&\n replaceExceptionFramesInException(event.exception.values[0], symbolicatedFrames);\n } else if (event.threads) {\n // RN JS doesn't have threads\n symbolicatedFrames && replaceThreadFramesInEvent(event, symbolicatedFrames);\n }\n }\n\n return event;\n}\n\n/**\n * Symbolicates the stack on the device talking to local dev server.\n * Mutates the passed event.\n */\nasync function symbolicate(rawStack: string, skipFirstFrames: number = 0): Promise<SentryStackFrame[] | null> {\n try {\n const parsedStack = parseErrorStack(rawStack);\n\n const prettyStack = await symbolicateStackTrace(parsedStack);\n if (!prettyStack) {\n debug.error('React Native DevServer could not symbolicate the stack trace.');\n return null;\n }\n\n // This has been changed in an react-native version so stack is contained in here\n const newStack = 'stack' in prettyStack ? prettyStack.stack : prettyStack;\n\n // https://github.com/getsentry/sentry-javascript/blob/739d904342aaf9327312f409952f14ceff4ae1ab/packages/utils/src/stacktrace.ts#L23\n // Match SentryParser which counts lines of stack (-1 for first line with the Error message)\n const skipFirstAdjustedToSentryStackParser = Math.max(skipFirstFrames - 1, 0);\n const stackWithoutPoppedFrames = skipFirstAdjustedToSentryStackParser\n ? newStack.slice(skipFirstAdjustedToSentryStackParser)\n : newStack;\n\n const stackWithoutInternalCallsites = stackWithoutPoppedFrames.filter(\n (frame: { file?: string }) => frame.file && frame.file.match(INTERNAL_CALLSITES_REGEX) === null,\n );\n\n const sentryFrames = await convertReactNativeFramesToSentryFrames(stackWithoutInternalCallsites);\n return await fetchSourceContext(sentryFrames);\n } catch (error) {\n if (error instanceof Error) {\n debug.warn(`Unable to symbolicate stack trace: ${error.message}`);\n }\n return null;\n }\n}\n\n/**\n * Converts ReactNativeFrames to frames in the Sentry format\n * @param frames ReactNativeFrame[]\n */\nasync function convertReactNativeFramesToSentryFrames(frames: ReactNative.StackFrame[]): Promise<SentryStackFrame[]> {\n return Promise.all(\n frames.map(async (frame: ReactNative.StackFrame): Promise<SentryStackFrame> => {\n let inApp = !!frame.column && !!frame.lineNumber;\n inApp =\n inApp &&\n frame.file !== undefined &&\n !frame.file.includes('node_modules') &&\n !frame.file.includes('native code');\n\n const newFrame: SentryStackFrame = {\n lineno: frame.lineNumber,\n colno: frame.column,\n filename: frame.file,\n function: frame.methodName,\n in_app: inApp,\n };\n\n return newFrame;\n }),\n );\n}\n\n/**\n * Replaces the frames in the exception of a error.\n * @param event Event\n * @param frames StackFrame[]\n */\nfunction replaceExceptionFramesInException(exception: Exception | undefined, frames: SentryStackFrame[]): void {\n if (exception?.stacktrace) {\n exception.stacktrace.frames = frames.reverse();\n }\n}\n\n/**\n * Replaces the frames in the thread of a message.\n * @param event Event\n * @param frames StackFrame[]\n */\nfunction replaceThreadFramesInEvent(event: Event, frames: SentryStackFrame[]): void {\n if (event.threads?.values?.[0]?.stacktrace) {\n event.threads.values[0].stacktrace.frames = frames.reverse();\n }\n}\n\n/**\n * Return a list containing the original exception and also the cause if found.\n *\n * @param originalException The original exception.\n */\nfunction getExceptionGroup(originalException: unknown): (Error & { stack: string })[] {\n const err = originalException as ExtendedError;\n const errorGroup: (Error & { stack: string })[] = [];\n for (let cause: ExtendedError | undefined = err; isErrorLike(cause); cause = cause.cause) {\n errorGroup.push(cause);\n }\n return errorGroup;\n}\n"]}
1
+ {"version":3,"file":"debugsymbolicator.js","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicator.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtG,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAE7C,sEAAsE;AACtE,MAAM,wBAAwB,GAAG,IAAI,MAAM,CAAC,CAAC,+BAA+B,EAAE,oBAAoB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAY/G,6DAA6D;AAC7D,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAgB,EAAE;IAC5D,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,UAAU;QACZ,CAAC;QACD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF,SAAe,YAAY,CAAC,KAAY,EAAE,IAAe;;;QACvD,IAAI,CAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,KAAI,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACnE,wCAAwC;YACxC,MAAM,UAAU,GAAG,iBAAiB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YAC7D,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;gBAClD,MAAM,kBAAkB,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;gBAEjF,kBAAkB,IAAI,iCAAiC,CAAC,KAAK,CAAC,SAAS,CAAC,MA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MAAM;gBACnB,QAAQ,EAAE,KAAK,CAAC,IAAI;gBACpB,QAAQ,EAAE,KAAK,CAAC,UAAU;gBAC1B,MAAM,EAAE,KAAK;aACd,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA,CAAC,CACH,CAAC;IACJ,CAAC;CAAA;AAED;;;;GAIG;AACH,SAAS,iCAAiC,CAAC,SAAgC,EAAE,MAA0B;IACrG,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,EAAE,CAAC;QAC1B,SAAS,CAAC,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IACjD,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,0BAA0B,CAAC,KAAY,EAAE,MAA0B;;IAC1E,IAAI,MAAA,MAAA,MAAA,KAAK,CAAC,OAAO,0CAAE,MAAM,0CAAG,CAAC,CAAC,0CAAE,UAAU,EAAE,CAAC;QAC3C,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IAC/D,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,iBAA0B;IACnD,MAAM,GAAG,GAAG,iBAAkC,CAAC;IAC/C,MAAM,UAAU,GAAkC,EAAE,CAAC;IACrD,KAAK,IAAI,KAAK,GAA8B,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;QACzF,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type { Event, EventHint, Exception, Integration, StackFrame as SentryStackFrame } from '@sentry/core';\nimport { debug } from '@sentry/core';\nimport type { ExtendedError } from '../utils/error';\nimport { getFramesToPop, isErrorLike } from '../utils/error';\nimport type * as ReactNative from '../vendor/react-native';\nimport { fetchSourceContext, parseErrorStack, symbolicateStackTrace } from './debugsymbolicatorutils';\n\nconst INTEGRATION_NAME = 'DebugSymbolicator';\n\n// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\nconst INTERNAL_CALLSITES_REGEX = new RegExp(['ReactNativeRenderer-dev\\\\.js$', 'MessageQueue\\\\.js$'].join('|'));\n\n/**\n * React Native Error\n */\nexport type ReactNativeError = Error & {\n framesToPop?: number;\n jsEngine?: string;\n preventSymbolication?: boolean;\n componentStack?: string;\n};\n\n/** Tries to symbolicate the JS stack trace on the device. */\nexport const debugSymbolicatorIntegration = (): 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 if (event.exception?.values && isErrorLike(hint.originalException)) {\n // originalException is ErrorLike object\n const errorGroup = getExceptionGroup(hint.originalException);\n for (const [index, error] of errorGroup.entries()) {\n const symbolicatedFrames = await symbolicate(error.stack, getFramesToPop(error));\n\n symbolicatedFrames && replaceExceptionFramesInException(event.exception.values[index], symbolicatedFrames);\n }\n } else if (hint.syntheticException && isErrorLike(hint.syntheticException)) {\n // syntheticException is Error object\n const symbolicatedFrames = await symbolicate(\n hint.syntheticException.stack,\n getFramesToPop(hint.syntheticException),\n );\n\n if (event.exception) {\n symbolicatedFrames &&\n event.exception.values &&\n replaceExceptionFramesInException(event.exception.values[0], symbolicatedFrames);\n } else if (event.threads) {\n // RN JS doesn't have threads\n symbolicatedFrames && replaceThreadFramesInEvent(event, symbolicatedFrames);\n }\n }\n\n return event;\n}\n\n/**\n * Symbolicates the stack on the device talking to local dev server.\n * Mutates the passed event.\n */\nasync function symbolicate(rawStack: string, skipFirstFrames: number = 0): Promise<SentryStackFrame[] | null> {\n try {\n const parsedStack = parseErrorStack(rawStack);\n\n const prettyStack = await symbolicateStackTrace(parsedStack);\n if (!prettyStack) {\n debug.error('React Native DevServer could not symbolicate the stack trace.');\n return null;\n }\n\n // This has been changed in an react-native version so stack is contained in here\n const newStack = 'stack' in prettyStack ? prettyStack.stack : prettyStack;\n\n // https://github.com/getsentry/sentry-javascript/blob/739d904342aaf9327312f409952f14ceff4ae1ab/packages/utils/src/stacktrace.ts#L23\n // Match SentryParser which counts lines of stack (-1 for first line with the Error message)\n const skipFirstAdjustedToSentryStackParser = Math.max(skipFirstFrames - 1, 0);\n const stackWithoutPoppedFrames = skipFirstAdjustedToSentryStackParser\n ? newStack.slice(skipFirstAdjustedToSentryStackParser)\n : newStack;\n\n const stackWithoutInternalCallsites = stackWithoutPoppedFrames.filter(\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- keep falsy check for empty string file paths\n (frame: { file?: string }) => frame.file && frame.file.match(INTERNAL_CALLSITES_REGEX) === null,\n );\n\n const sentryFrames = await convertReactNativeFramesToSentryFrames(stackWithoutInternalCallsites);\n return await fetchSourceContext(sentryFrames);\n } catch (error) {\n if (error instanceof Error) {\n debug.warn(`Unable to symbolicate stack trace: ${error.message}`);\n }\n return null;\n }\n}\n\n/**\n * Converts ReactNativeFrames to frames in the Sentry format\n * @param frames ReactNativeFrame[]\n */\nasync function convertReactNativeFramesToSentryFrames(frames: ReactNative.StackFrame[]): Promise<SentryStackFrame[]> {\n return Promise.all(\n frames.map(async (frame: ReactNative.StackFrame): Promise<SentryStackFrame> => {\n let inApp = !!frame.column && !!frame.lineNumber;\n inApp =\n inApp &&\n frame.file !== undefined &&\n !frame.file.includes('node_modules') &&\n !frame.file.includes('native code');\n\n const newFrame: SentryStackFrame = {\n lineno: frame.lineNumber,\n colno: frame.column,\n filename: frame.file,\n function: frame.methodName,\n in_app: inApp,\n };\n\n return newFrame;\n }),\n );\n}\n\n/**\n * Replaces the frames in the exception of a error.\n * @param event Event\n * @param frames StackFrame[]\n */\nfunction replaceExceptionFramesInException(exception: Exception | undefined, frames: SentryStackFrame[]): void {\n if (exception?.stacktrace) {\n exception.stacktrace.frames = frames.reverse();\n }\n}\n\n/**\n * Replaces the frames in the thread of a message.\n * @param event Event\n * @param frames StackFrame[]\n */\nfunction replaceThreadFramesInEvent(event: Event, frames: SentryStackFrame[]): void {\n if (event.threads?.values?.[0]?.stacktrace) {\n event.threads.values[0].stacktrace.frames = frames.reverse();\n }\n}\n\n/**\n * Return a list containing the original exception and also the cause if found.\n *\n * @param originalException The original exception.\n */\nfunction getExceptionGroup(originalException: unknown): (Error & { stack: string })[] {\n const err = originalException as ExtendedError;\n const errorGroup: (Error & { stack: string })[] = [];\n for (let cause: ExtendedError | undefined = err; isErrorLike(cause); cause = cause.cause) {\n errorGroup.push(cause);\n }\n return errorGroup;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"debugsymbolicatorutils.js","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicatorutils.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGrE;;;;;GAKG;AACH,MAAM,UAAgB,kBAAkB,CAAC,MAA0B;;QACjE,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YAC3B,IAAI;gBACF,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;gBAC/B,IAAI,CAAC,GAAG,EAAE;oBACR,OAAO,CAAC,MAAM,CAAC,CAAC;oBAChB,OAAO;iBACR;gBAED,MAAM,GAAG,GAAG,8BAA8B,EAAE,CAAC;gBAC7C,IAAI,CAAC,GAAG,EAAE;oBACR,KAAK,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;oBACxE,OAAO,CAAC,MAAM,CAAC,CAAC;oBAChB,OAAO;iBACR;gBAED,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;gBAC5B,GAAG,CAAC,gBAAgB,C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oB,CAAC,QAAQ,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;KACzD;IACD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;AACnE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAoC,EACpC,SAAmC;IAEnC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;KACzD;IACD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAC/E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY;;IAC1B,IAAI;QACF,OAAO,MAAA,oBAAoB,CAAC,QAAQ,0CAAE,YAAY,EAAE,CAAC;KACtD;IAAC,OAAO,GAAG,EAAE;QACZ,8BAA8B;KAC/B;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { StackFrame as SentryStackFrame } from '@sentry/core';\nimport { debug } from '@sentry/core';\nimport { ReactNativeLibraries } from '../utils/rnlibraries';\nimport { createStealthXhr, XHR_READYSTATE_DONE } from '../utils/xhr';\nimport type * as ReactNative from '../vendor/react-native';\n\n/**\n * Fetches source context for the Sentry Middleware (/__sentry/context)\n *\n * @param frame StackFrame\n * @param getDevServer function from RN to get DevServer URL\n */\nexport async function fetchSourceContext(frames: SentryStackFrame[]): Promise<SentryStackFrame[]> {\n return new Promise(resolve => {\n try {\n const xhr = createStealthXhr();\n if (!xhr) {\n resolve(frames);\n return;\n }\n\n const url = getSentryMetroSourceContextUrl();\n if (!url) {\n debug.error('Could not fetch source context. No dev server URL found.');\n resolve(frames);\n return;\n }\n\n xhr.open('POST', url, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(JSON.stringify({ stack: frames }));\n\n xhr.onreadystatechange = (): void => {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n if (xhr.status !== 200) {\n resolve(frames);\n }\n\n try {\n const response: { stack?: SentryStackFrame[] } = JSON.parse(xhr.responseText);\n if (Array.isArray(response.stack)) {\n resolve(response.stack);\n } else {\n resolve(frames);\n }\n } catch (error) {\n resolve(frames);\n }\n }\n };\n xhr.onerror = (): void => {\n resolve(frames);\n };\n } catch (error) {\n debug.error('Could not fetch source context.', error);\n resolve(frames);\n }\n });\n}\n\nfunction getSentryMetroSourceContextUrl(): string | undefined {\n const devServer = getDevServer();\n\n if (!devServer) {\n return undefined;\n }\n\n return `${devServer.url}__sentry/context`;\n}\n\n/**\n * Loads and calls RN Core Devtools parseErrorStack function.\n */\nexport function parseErrorStack(errorStack: string): Array<ReactNative.StackFrame> {\n if (!ReactNativeLibraries.Devtools) {\n throw new Error('React Native Devtools not available.');\n }\n return ReactNativeLibraries.Devtools.parseErrorStack(errorStack);\n}\n\n/**\n * Loads and calls RN Core Devtools symbolicateStackTrace function.\n */\nexport function symbolicateStackTrace(\n stack: Array<ReactNative.StackFrame>,\n extraData?: Record<string, unknown>,\n): Promise<ReactNative.SymbolicatedStackTrace> {\n if (!ReactNativeLibraries.Devtools) {\n throw new Error('React Native Devtools not available.');\n }\n return ReactNativeLibraries.Devtools.symbolicateStackTrace(stack, extraData);\n}\n\n/**\n * Loads and returns the RN DevServer URL.\n */\nexport function getDevServer(): ReactNative.DevServerInfo | undefined {\n try {\n return ReactNativeLibraries.Devtools?.getDevServer();\n } catch (_oO) {\n // We can't load devserver URL\n }\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"debugsymbolicatorutils.js","sourceRoot":"","sources":["../../../src/js/integrations/debugsymbolicatorutils.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGrE;;;;;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ACvD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,8BAA8B;IAChC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { StackFrame as SentryStackFrame } from '@sentry/core';\nimport { debug } from '@sentry/core';\nimport { ReactNativeLibraries } from '../utils/rnlibraries';\nimport { createStealthXhr, XHR_READYSTATE_DONE } from '../utils/xhr';\nimport type * as ReactNative from '../vendor/react-native';\n\n/**\n * Fetches source context for the Sentry Middleware (/__sentry/context)\n *\n * @param frame StackFrame\n * @param getDevServer function from RN to get DevServer URL\n */\nexport async function fetchSourceContext(frames: SentryStackFrame[]): Promise<SentryStackFrame[]> {\n return new Promise(resolve => {\n try {\n const xhr = createStealthXhr();\n if (!xhr) {\n resolve(frames);\n return;\n }\n\n const url = getSentryMetroSourceContextUrl();\n if (!url) {\n debug.error('Could not fetch source context. No dev server URL found.');\n resolve(frames);\n return;\n }\n\n xhr.open('POST', url, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(JSON.stringify({ stack: frames }));\n\n xhr.onreadystatechange = (): void => {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n if (xhr.status !== 200) {\n resolve(frames);\n }\n\n try {\n const response: { stack?: SentryStackFrame[] } = JSON.parse(xhr.responseText);\n if (Array.isArray(response.stack)) {\n resolve(response.stack);\n } else {\n resolve(frames);\n }\n } catch (error) {\n resolve(frames);\n }\n }\n };\n xhr.onerror = (): void => {\n resolve(frames);\n };\n } catch (error) {\n debug.error('Could not fetch source context.', error);\n resolve(frames);\n }\n });\n}\n\nfunction getSentryMetroSourceContextUrl(): string | undefined {\n const devServer = getDevServer();\n\n if (!devServer) {\n return undefined;\n }\n\n return `${devServer.url}__sentry/context`;\n}\n\n/**\n * Loads and calls RN Core Devtools parseErrorStack function.\n */\nexport function parseErrorStack(errorStack: string): Array<ReactNative.StackFrame> {\n if (!ReactNativeLibraries.Devtools) {\n throw new Error('React Native Devtools not available.');\n }\n return ReactNativeLibraries.Devtools.parseErrorStack(errorStack);\n}\n\n/**\n * Loads and calls RN Core Devtools symbolicateStackTrace function.\n */\nexport function symbolicateStackTrace(\n stack: Array<ReactNative.StackFrame>,\n extraData?: Record<string, unknown>,\n): Promise<ReactNative.SymbolicatedStackTrace> {\n if (!ReactNativeLibraries.Devtools) {\n throw new Error('React Native Devtools not available.');\n }\n return ReactNativeLibraries.Devtools.symbolicateStackTrace(stack, extraData);\n}\n\n/**\n * Loads and returns the RN DevServer URL.\n */\nexport function getDevServer(): ReactNative.DevServerInfo | undefined {\n try {\n return ReactNativeLibraries.Devtools?.getDevServer();\n } catch (_oO) {\n // We can't load devserver URL\n }\n return undefined;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAwC3D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,EAAE,CAoHvF"}
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAyC3D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,EAAE,CAqHvF"}
@@ -2,7 +2,7 @@
2
2
  import { browserSessionIntegration, consoleLoggingIntegration } from '@sentry/browser';
3
3
  import { reactNativeTracingIntegration } from '../tracing';
4
4
  import { notWeb } from '../utils/environment';
5
- import { appRegistryIntegration, appStartIntegration, breadcrumbsIntegration, browserApiErrorsIntegration, browserGlobalHandlersIntegration, browserLinkedErrorsIntegration, createNativeFramesIntegrations, createReactNativeRewriteFrames, debugSymbolicatorIntegration, dedupeIntegration, deviceContextIntegration, eventOriginIntegration, expoConstantsIntegration, expoContextIntegration, functionToStringIntegration, hermesProfilingIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, logEnricherIntegration, mobileReplayIntegration, modulesLoaderIntegration, nativeLinkedErrorsIntegration, nativeReleaseIntegration, primitiveTagIntegration, reactNativeErrorHandlersIntegration, reactNativeInfoIntegration, screenshotIntegration, sdkInfoIntegration, spotlightIntegration, stallTrackingIntegration, timeToDisplayIntegration, userInteractionIntegration, viewHierarchyIntegration, } from './exports';
5
+ import { appRegistryIntegration, appStartIntegration, breadcrumbsIntegration, browserApiErrorsIntegration, browserGlobalHandlersIntegration, browserLinkedErrorsIntegration, createNativeFramesIntegrations, createReactNativeRewriteFrames, debugSymbolicatorIntegration, dedupeIntegration, deviceContextIntegration, eventOriginIntegration, expoConstantsIntegration, expoContextIntegration, expoUpdatesListenerIntegration, functionToStringIntegration, hermesProfilingIntegration, httpClientIntegration, httpContextIntegration, inboundFiltersIntegration, logEnricherIntegration, mobileReplayIntegration, modulesLoaderIntegration, nativeLinkedErrorsIntegration, nativeReleaseIntegration, primitiveTagIntegration, reactNativeErrorHandlersIntegration, reactNativeInfoIntegration, screenshotIntegration, sdkInfoIntegration, spotlightIntegration, stallTrackingIntegration, timeToDisplayIntegration, userInteractionIntegration, viewHierarchyIntegration, } from './exports';
6
6
  /**
7
7
  * Returns the default ReactNative integrations based on the current environment.
8
8
  *
@@ -85,6 +85,7 @@ export function getDefaultIntegrations(options) {
85
85
  }
86
86
  integrations.push(expoContextIntegration());
87
87
  integrations.push(expoConstantsIntegration());
88
+ integrations.push(expoUpdatesListenerIntegration());
88
89
  if (options.spotlight && __DEV__) {
89
90
  const sidecarUrl = typeof options.spotlight === 'string' ? options.spotlight : undefined;
90
91
  integrations.push(spotlightIntegration({ sidecarUrl }));
@@ -93,7 +94,7 @@ export function getDefaultIntegrations(options) {
93
94
  const hasExperimentsReplayOptions = (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||
94
95
  (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number');
95
96
  if (!hasReplayOptions && hasExperimentsReplayOptions) {
96
- // Remove in the next major version (v7)
97
+ // Remove in the next major version (v9)
97
98
  options.replaysOnErrorSampleRate = (_a = options._experiments) === null || _a === void 0 ? void 0 : _a.replaysOnErrorSampleRate;
98
99
  options.replaysSessionSampleRate = (_b = options._experiments) === null || _b === void 0 ? void 0 : _b.replaysSessionSampleRate;
99
100
  }
@@ -1 +1 @@
1
- {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAGvF,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,6BAA6B,EAC7B,wBAAwB,EACxB,uBAAuB,EACvB,mCAAmC,EACnC,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,WAAW,CAAC;AAEnB;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAiC;;IACtE,MAA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,YAAY,0CAAE,wBAAwB,CAAC;QAClF,OAAO,CAAC,wBAAwB,GAAG,MAAA,OAAO,CAAC,YAAY,0CAAE,wBAAwB,CAAC;KACnF;IAED,IAAI,CAAC,gBAAgB,IAAI,2BAA2B,CAAC,IAAI,MAAM,EAAE,EAAE;QACjE,0FAA0F;QAC1F,yFAAyF;QACzF,YAAY,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;KAC9C;IAED,IAAI,OAAO,IAAI,MAAM,EAAE,EAAE;QACvB,YAAY,CAAC,IAAI,CAAC,4BAA4B,EAAE,CAAC,CAAC;KACnD;IAED,YAAY,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;IAE7C,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport { browserSessionIntegration, consoleLoggingIntegration } from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport type { ReactNativeClientOptions } from '../options';\nimport { reactNativeTracingIntegration } from '../tracing';\nimport { notWeb } from '../utils/environment';\nimport {\n appRegistryIntegration,\n appStartIntegration,\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n browserGlobalHandlersIntegration,\n browserLinkedErrorsIntegration,\n createNativeFramesIntegrations,\n createReactNativeRewriteFrames,\n debugSymbolicatorIntegration,\n dedupeIntegration,\n deviceContextIntegration,\n eventOriginIntegration,\n expoConstantsIntegration,\n expoContextIntegration,\n functionToStringIntegration,\n hermesProfilingIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n logEnricherIntegration,\n mobileReplayIntegration,\n modulesLoaderIntegration,\n nativeLinkedErrorsIntegration,\n nativeReleaseIntegration,\n primitiveTagIntegration,\n reactNativeErrorHandlersIntegration,\n reactNativeInfoIntegration,\n screenshotIntegration,\n sdkInfoIntegration,\n spotlightIntegration,\n stallTrackingIntegration,\n timeToDisplayIntegration,\n userInteractionIntegration,\n viewHierarchyIntegration,\n} from './exports';\n\n/**\n * Returns the default ReactNative integrations based on the current environment.\n *\n * Native integrations are only returned when native is enabled.\n *\n * Web integrations are only returned when running on web.\n */\nexport function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[] {\n const integrations: Integration[] = [];\n\n if (notWeb()) {\n integrations.push(\n reactNativeErrorHandlersIntegration({\n patchGlobalPromise: options.patchGlobalPromise,\n }),\n );\n integrations.push(nativeLinkedErrorsIntegration());\n } else {\n integrations.push(browserApiErrorsIntegration());\n integrations.push(browserGlobalHandlersIntegration());\n integrations.push(browserLinkedErrorsIntegration());\n\n if (options.enableAutoSessionTracking) {\n integrations.push(browserSessionIntegration());\n }\n }\n\n // @sentry/react default integrations\n integrations.push(inboundFiltersIntegration());\n integrations.push(functionToStringIntegration());\n integrations.push(breadcrumbsIntegration());\n integrations.push(dedupeIntegration());\n integrations.push(httpContextIntegration());\n // end @sentry/react-native default integrations\n\n integrations.push(nativeReleaseIntegration());\n integrations.push(eventOriginIntegration());\n integrations.push(sdkInfoIntegration());\n integrations.push(reactNativeInfoIntegration());\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(deviceContextIntegration());\n integrations.push(modulesLoaderIntegration());\n if (options.enableLogs && options.logsOrigin !== 'native') {\n integrations.push(logEnricherIntegration());\n integrations.push(consoleLoggingIntegration());\n }\n if (options.attachScreenshot) {\n integrations.push(screenshotIntegration());\n }\n if (options.attachViewHierarchy) {\n integrations.push(viewHierarchyIntegration());\n }\n if (typeof options.profilesSampleRate === 'number') {\n integrations.push(hermesProfilingIntegration());\n }\n }\n\n // hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present\n // that's different from prev imp here and might lead misconfiguration\n // `tracesSampleRate: undefined` should not enable tracing\n const hasTracingEnabled = typeof options.tracesSampleRate === 'number' || typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAppStartTracking && options.enableNative) {\n integrations.push(appStartIntegration());\n }\n const nativeFramesIntegrationInstance = createNativeFramesIntegrations(\n hasTracingEnabled && options.enableNativeFramesTracking && options.enableNative,\n );\n if (nativeFramesIntegrationInstance) {\n integrations.push(nativeFramesIntegrationInstance);\n }\n if (hasTracingEnabled && options.enableStallTracking) {\n integrations.push(stallTrackingIntegration());\n }\n if (hasTracingEnabled && options.enableUserInteractionTracing) {\n integrations.push(userInteractionIntegration());\n }\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(appRegistryIntegration());\n integrations.push(reactNativeTracingIntegration());\n }\n if (hasTracingEnabled) {\n integrations.push(timeToDisplayIntegration());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(httpClientIntegration());\n }\n\n integrations.push(expoContextIntegration());\n integrations.push(expoConstantsIntegration());\n\n if (options.spotlight && __DEV__) {\n const sidecarUrl = typeof options.spotlight === 'string' ? options.spotlight : undefined;\n integrations.push(spotlightIntegration({ sidecarUrl }));\n }\n\n const hasReplayOptions =\n typeof options.replaysOnErrorSampleRate === 'number' || typeof options.replaysSessionSampleRate === 'number';\n const hasExperimentsReplayOptions =\n (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||\n (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number');\n\n if (!hasReplayOptions && hasExperimentsReplayOptions) {\n // Remove in the next major version (v7)\n options.replaysOnErrorSampleRate = options._experiments?.replaysOnErrorSampleRate;\n options.replaysSessionSampleRate = options._experiments?.replaysSessionSampleRate;\n }\n\n if ((hasReplayOptions || hasExperimentsReplayOptions) && notWeb()) {\n // We can't create and add browserReplayIntegration as it overrides the users supplied one\n // The browser replay integration works differently than the rest of default integrations\n integrations.push(mobileReplayIntegration());\n }\n\n if (__DEV__ && notWeb()) {\n integrations.push(debugSymbolicatorIntegration());\n }\n\n integrations.push(primitiveTagIntegration());\n\n return integrations;\n}\n"]}
1
+ {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/js/integrations/default.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAA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YAAY,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,OAAO,IAAI,MAAM,EAAE,EAAE,CAAC;QACxB,YAAY,CAAC,IAAI,CAAC,4BAA4B,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,YAAY,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;IAE7C,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport { browserSessionIntegration, consoleLoggingIntegration } from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport type { ReactNativeClientOptions } from '../options';\nimport { reactNativeTracingIntegration } from '../tracing';\nimport { notWeb } from '../utils/environment';\nimport {\n appRegistryIntegration,\n appStartIntegration,\n breadcrumbsIntegration,\n browserApiErrorsIntegration,\n browserGlobalHandlersIntegration,\n browserLinkedErrorsIntegration,\n createNativeFramesIntegrations,\n createReactNativeRewriteFrames,\n debugSymbolicatorIntegration,\n dedupeIntegration,\n deviceContextIntegration,\n eventOriginIntegration,\n expoConstantsIntegration,\n expoContextIntegration,\n expoUpdatesListenerIntegration,\n functionToStringIntegration,\n hermesProfilingIntegration,\n httpClientIntegration,\n httpContextIntegration,\n inboundFiltersIntegration,\n logEnricherIntegration,\n mobileReplayIntegration,\n modulesLoaderIntegration,\n nativeLinkedErrorsIntegration,\n nativeReleaseIntegration,\n primitiveTagIntegration,\n reactNativeErrorHandlersIntegration,\n reactNativeInfoIntegration,\n screenshotIntegration,\n sdkInfoIntegration,\n spotlightIntegration,\n stallTrackingIntegration,\n timeToDisplayIntegration,\n userInteractionIntegration,\n viewHierarchyIntegration,\n} from './exports';\n\n/**\n * Returns the default ReactNative integrations based on the current environment.\n *\n * Native integrations are only returned when native is enabled.\n *\n * Web integrations are only returned when running on web.\n */\nexport function getDefaultIntegrations(options: ReactNativeClientOptions): Integration[] {\n const integrations: Integration[] = [];\n\n if (notWeb()) {\n integrations.push(\n reactNativeErrorHandlersIntegration({\n patchGlobalPromise: options.patchGlobalPromise,\n }),\n );\n integrations.push(nativeLinkedErrorsIntegration());\n } else {\n integrations.push(browserApiErrorsIntegration());\n integrations.push(browserGlobalHandlersIntegration());\n integrations.push(browserLinkedErrorsIntegration());\n\n if (options.enableAutoSessionTracking) {\n integrations.push(browserSessionIntegration());\n }\n }\n\n // @sentry/react default integrations\n integrations.push(inboundFiltersIntegration());\n integrations.push(functionToStringIntegration());\n integrations.push(breadcrumbsIntegration());\n integrations.push(dedupeIntegration());\n integrations.push(httpContextIntegration());\n // end @sentry/react-native default integrations\n\n integrations.push(nativeReleaseIntegration());\n integrations.push(eventOriginIntegration());\n integrations.push(sdkInfoIntegration());\n integrations.push(reactNativeInfoIntegration());\n\n integrations.push(createReactNativeRewriteFrames());\n\n if (options.enableNative) {\n integrations.push(deviceContextIntegration());\n integrations.push(modulesLoaderIntegration());\n if (options.enableLogs && options.logsOrigin !== 'native') {\n integrations.push(logEnricherIntegration());\n integrations.push(consoleLoggingIntegration());\n }\n if (options.attachScreenshot) {\n integrations.push(screenshotIntegration());\n }\n if (options.attachViewHierarchy) {\n integrations.push(viewHierarchyIntegration());\n }\n if (typeof options.profilesSampleRate === 'number') {\n integrations.push(hermesProfilingIntegration());\n }\n }\n\n // hasTracingEnabled from `@sentry/core` only check if tracesSampler or tracesSampleRate keys are present\n // that's different from prev imp here and might lead misconfiguration\n // `tracesSampleRate: undefined` should not enable tracing\n const hasTracingEnabled = typeof options.tracesSampleRate === 'number' || typeof options.tracesSampler === 'function';\n if (hasTracingEnabled && options.enableAppStartTracking && options.enableNative) {\n integrations.push(appStartIntegration());\n }\n const nativeFramesIntegrationInstance = createNativeFramesIntegrations(\n hasTracingEnabled && options.enableNativeFramesTracking && options.enableNative,\n );\n if (nativeFramesIntegrationInstance) {\n integrations.push(nativeFramesIntegrationInstance);\n }\n if (hasTracingEnabled && options.enableStallTracking) {\n integrations.push(stallTrackingIntegration());\n }\n if (hasTracingEnabled && options.enableUserInteractionTracing) {\n integrations.push(userInteractionIntegration());\n }\n if (hasTracingEnabled && options.enableAutoPerformanceTracing) {\n integrations.push(appRegistryIntegration());\n integrations.push(reactNativeTracingIntegration());\n }\n if (hasTracingEnabled) {\n integrations.push(timeToDisplayIntegration());\n }\n if (options.enableCaptureFailedRequests) {\n integrations.push(httpClientIntegration());\n }\n\n integrations.push(expoContextIntegration());\n integrations.push(expoConstantsIntegration());\n integrations.push(expoUpdatesListenerIntegration());\n\n if (options.spotlight && __DEV__) {\n const sidecarUrl = typeof options.spotlight === 'string' ? options.spotlight : undefined;\n integrations.push(spotlightIntegration({ sidecarUrl }));\n }\n\n const hasReplayOptions =\n typeof options.replaysOnErrorSampleRate === 'number' || typeof options.replaysSessionSampleRate === 'number';\n const hasExperimentsReplayOptions =\n (options._experiments && typeof options._experiments.replaysOnErrorSampleRate === 'number') ||\n (options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number');\n\n if (!hasReplayOptions && hasExperimentsReplayOptions) {\n // Remove in the next major version (v9)\n options.replaysOnErrorSampleRate = options._experiments?.replaysOnErrorSampleRate;\n options.replaysSessionSampleRate = options._experiments?.replaysSessionSampleRate;\n }\n\n if ((hasReplayOptions || hasExperimentsReplayOptions) && notWeb()) {\n // We can't create and add browserReplayIntegration as it overrides the users supplied one\n // The browser replay integration works differently than the rest of default integrations\n integrations.push(mobileReplayIntegration());\n }\n\n if (__DEV__ && notWeb()) {\n integrations.push(debugSymbolicatorIntegration());\n }\n\n integrations.push(primitiveTagIntegration());\n\n return integrations;\n}\n"]}
@@ -23,8 +23,8 @@ export const deviceContextIntegration = () => {
23
23
  };
24
24
  };
25
25
  function processEvent(event, _hint, client) {
26
- var _a, _b;
27
26
  return __awaiter(this, void 0, void 0, function* () {
27
+ var _a, _b;
28
28
  let native = null;
29
29
  try {
30
30
  native = yield NATIVE.fetchNativeDeviceContexts();
@@ -1 +1 @@
1
- {"version":3,"file":"devicecontext.js","sourceRoot":"","sources":["../../../src/js/integrations/devicecontext.ts"],"names":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C,WAAW,IAAI,iBAAiB,EAAE;YAC3C,KAAK,CAAC,WAAW,GAAG,iBAAiB,CAAC;SACvC;QAED,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAC5D,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC;YACjD,CAAC,CAAC,SAAS,CAAC;QACd,IAAI,iBAAiB,EAAE;YACrB,MAAM,cAAc,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,GAAG,cAAc,mCAAI,GAAG,CAAC,CAAC,kBAAkB;YACrF,KAAK,CAAC,WAAW,GAAG,iBAAiB;iBAClC,MAAM,CAAC,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,4CAA4C;iBAC5E,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,eAAC,OAAA,CAAC,MAAA,CAAC,CAAC,SAAS,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,CAAC,CAAC,SAAS,mCAAI,CAAC,CAAC,CAAA,EAAA,CAAC,CAAC,oBAAoB;iBAC5E,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,+BAA+B;SAC3D;QAED,OAAO,KAAK,CAAC;;CACd","sourcesContent":["/* eslint-disable complexity */\nimport type { Client, Event, EventHint, Integration } from '@sentry/core';\nimport { debug, severityLevelFromString } from '@sentry/core';\nimport { AppState } from 'react-native';\nimport { breadcrumbFromObject } from '../breadcrumb';\nimport type { NativeDeviceContextsResponse } from '../NativeRNSentry';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'DeviceContext';\n\n/** Load device context from native. */\nexport const deviceContextIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n /* noop */\n },\n processEvent,\n };\n};\n\nasync function processEvent(event: Event, _hint: EventHint, client: Client): Promise<Event> {\n let native: NativeDeviceContextsResponse | null = null;\n try {\n native = await NATIVE.fetchNativeDeviceContexts();\n } catch (e) {\n debug.log(`Failed to get device context from native: ${e}`);\n }\n\n if (!native) {\n return event;\n }\n\n const nativeUser = native.user;\n if (!event.user && nativeUser) {\n event.user = nativeUser;\n }\n\n let nativeContexts = native.contexts;\n if (AppState.currentState !== 'unknown') {\n nativeContexts = nativeContexts || {};\n nativeContexts.app = {\n ...nativeContexts.app,\n in_foreground: AppState.currentState === 'active',\n };\n }\n if (nativeContexts) {\n event.contexts = { ...nativeContexts, ...event.contexts };\n if (nativeContexts.app) {\n event.contexts.app = { ...nativeContexts.app, ...event.contexts.app };\n }\n }\n\n const nativeTags = native.tags;\n if (nativeTags) {\n event.tags = { ...nativeTags, ...event.tags };\n }\n\n const nativeExtra = native.extra;\n if (nativeExtra) {\n event.extra = { ...nativeExtra, ...event.extra };\n }\n\n const nativeFingerprint = native.fingerprint;\n if (nativeFingerprint) {\n event.fingerprint = (event.fingerprint ?? []).concat(\n nativeFingerprint.filter(item => (event.fingerprint ?? []).indexOf(item) < 0),\n );\n }\n\n const nativeLevel = typeof native['level'] === 'string' ? severityLevelFromString(native['level']) : undefined;\n if (!event.level && nativeLevel) {\n event.level = nativeLevel;\n }\n\n const nativeEnvironment = native['environment'];\n if (!event.environment && nativeEnvironment) {\n event.environment = nativeEnvironment;\n }\n\n const nativeBreadcrumbs = Array.isArray(native['breadcrumbs'])\n ? native['breadcrumbs'].map(breadcrumbFromObject)\n : undefined;\n if (nativeBreadcrumbs) {\n const maxBreadcrumbs = client?.getOptions().maxBreadcrumbs ?? 100; // Default is 100.\n event.breadcrumbs = nativeBreadcrumbs\n .concat(event.breadcrumbs || []) // concatenate the native and js breadcrumbs\n .sort((a, b) => (a.timestamp ?? 0) - (b.timestamp ?? 0)) // sort by timestamp\n .slice(-maxBreadcrumbs); // keep the last maxBreadcrumbs\n }\n\n return event;\n}\n"]}
1
+ {"version":3,"file":"devicecontext.js","sourceRoot":"","sources":["../../../src/js/integrations/devicecont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E,CAAC;YAChC,KAAK,CAAC,KAAK,GAAG,WAAW,CAAC;QAC5B,CAAC;QAED,MAAM,iBAAiB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;QAChD,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,iBAAiB,EAAE,CAAC;YAC5C,KAAK,CAAC,WAAW,GAAG,iBAAiB,CAAC;QACxC,CAAC;QAED,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAC5D,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC;YACjD,CAAC,CAAC,SAAS,CAAC;QACd,IAAI,iBAAiB,EAAE,CAAC;YACtB,MAAM,cAAc,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,GAAG,cAAc,mCAAI,GAAG,CAAC,CAAC,kBAAkB;YACrF,KAAK,CAAC,WAAW,GAAG,iBAAiB;iBAClC,MAAM,CAAC,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,4CAA4C;iBAC5E,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,eAAC,OAAA,CAAC,MAAA,CAAC,CAAC,SAAS,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,CAAC,CAAC,SAAS,mCAAI,CAAC,CAAC,CAAA,EAAA,CAAC,CAAC,oBAAoB;iBAC5E,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,+BAA+B;QAC5D,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CAAA","sourcesContent":["/* eslint-disable complexity */\nimport type { Client, Event, EventHint, Integration } from '@sentry/core';\nimport { debug, severityLevelFromString } from '@sentry/core';\nimport { AppState } from 'react-native';\nimport { breadcrumbFromObject } from '../breadcrumb';\nimport type { NativeDeviceContextsResponse } from '../NativeRNSentry';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'DeviceContext';\n\n/** Load device context from native. */\nexport const deviceContextIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n /* noop */\n },\n processEvent,\n };\n};\n\nasync function processEvent(event: Event, _hint: EventHint, client: Client): Promise<Event> {\n let native: NativeDeviceContextsResponse | null = null;\n try {\n native = await NATIVE.fetchNativeDeviceContexts();\n } catch (e) {\n debug.log(`Failed to get device context from native: ${e}`);\n }\n\n if (!native) {\n return event;\n }\n\n const nativeUser = native.user;\n if (!event.user && nativeUser) {\n event.user = nativeUser;\n }\n\n let nativeContexts = native.contexts;\n if (AppState.currentState !== 'unknown') {\n nativeContexts = nativeContexts || {};\n nativeContexts.app = {\n ...nativeContexts.app,\n in_foreground: AppState.currentState === 'active',\n };\n }\n if (nativeContexts) {\n event.contexts = { ...nativeContexts, ...event.contexts };\n if (nativeContexts.app) {\n event.contexts.app = { ...nativeContexts.app, ...event.contexts.app };\n }\n }\n\n const nativeTags = native.tags;\n if (nativeTags) {\n event.tags = { ...nativeTags, ...event.tags };\n }\n\n const nativeExtra = native.extra;\n if (nativeExtra) {\n event.extra = { ...nativeExtra, ...event.extra };\n }\n\n const nativeFingerprint = native.fingerprint;\n if (nativeFingerprint) {\n event.fingerprint = (event.fingerprint ?? []).concat(\n nativeFingerprint.filter(item => (event.fingerprint ?? []).indexOf(item) < 0),\n );\n }\n\n const nativeLevel = typeof native['level'] === 'string' ? severityLevelFromString(native['level']) : undefined;\n if (!event.level && nativeLevel) {\n event.level = nativeLevel;\n }\n\n const nativeEnvironment = native['environment'];\n if (!event.environment && nativeEnvironment) {\n event.environment = nativeEnvironment;\n }\n\n const nativeBreadcrumbs = Array.isArray(native['breadcrumbs'])\n ? native['breadcrumbs'].map(breadcrumbFromObject)\n : undefined;\n if (nativeBreadcrumbs) {\n const maxBreadcrumbs = client?.getOptions().maxBreadcrumbs ?? 100; // Default is 100.\n event.breadcrumbs = nativeBreadcrumbs\n .concat(event.breadcrumbs || []) // concatenate the native and js breadcrumbs\n .sort((a, b) => (a.timestamp ?? 0) - (b.timestamp ?? 0)) // sort by timestamp\n .slice(-maxBreadcrumbs); // keep the last maxBreadcrumbs\n }\n\n return event;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"expoconstants.js","sourceRoot":"","sources":["../../../src/js/integrations/expoconstants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAE3D,4CAA4C;AAC5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAgB,EAAE;IACxD,IAAI,2BAA6D,CAAC;IAElE,SAAS,YAAY,CAAC,KAAY;QAChC,IAAI,CAAC,MAAM,EAAE,EAAE;YACb,OAAO,KAAK,CAAC;SACd;QAED,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;QACtC,KAAK,CAAC,QAAQ,CAAC,0BAA0B,CAAC,qBACrC,6BAA6B,EAAE,CACnC,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,SAAS,6BAA6B;QACpC,IAAI,2BAA2B,EAAE;YAC/B,OAAO,2BAA2B,CAAC;SACpC;QAED,OAAO,CAAC,2BAA2B,GAAG,uBAAuB,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,OAAO,GAAyB,EAAE,CAAC;IAEzC,cAAc,CAAC,OAAO,EAAE,uBAAuB,EAAE,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OAAO;KACR;IAED,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACnE,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACnE,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACzE,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,kBAAkB,CAAC,OAA6B,EAAE,aAA4B;IACrF,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE;QAC5B,OAAO;KACR;IAED,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import type { Event, Integration } from '@sentry/core';\nimport { isExpo } from '../utils/environment';\nimport type { ExpoConstants } from '../utils/expoglobalobject';\nimport { getExpoConstants } from '../utils/expomodules';\n\nconst INTEGRATION_NAME = 'ExpoConstants';\n\nexport const EXPO_CONSTANTS_CONTEXT_KEY = 'expo_constants';\n\n/** Load Expo Constants as event context. */\nexport const expoConstantsIntegration = (): Integration => {\n let _expoConstantsContextCached: ExpoConstantsContext | undefined;\n\n function processEvent(event: Event): Event {\n if (!isExpo()) {\n return event;\n }\n\n event.contexts = event.contexts || {};\n event.contexts[EXPO_CONSTANTS_CONTEXT_KEY] = {\n ...getExpoConstantsContextCached(),\n };\n\n return event;\n }\n\n function getExpoConstantsContextCached(): ExpoConstantsContext {\n if (_expoConstantsContextCached) {\n return _expoConstantsContextCached;\n }\n\n return (_expoConstantsContextCached = getExpoConstantsContext());\n }\n\n return {\n name: INTEGRATION_NAME,\n processEvent,\n };\n};\n\n/**\n * @internal Exposed for testing purposes\n */\nexport function getExpoConstantsContext(): ExpoConstantsContext {\n const expoConstants = getExpoConstants();\n if (!expoConstants) {\n return {};\n }\n\n const context: ExpoConstantsContext = {};\n\n addStringField(context, 'execution_environment', expoConstants.executionEnvironment);\n addStringField(context, 'app_ownership', expoConstants.appOwnership);\n addBooleanField(context, 'debug_mode', expoConstants.debugMode);\n addStringField(context, 'expo_version', expoConstants.expoVersion);\n addStringField(context, 'expo_runtime_version', expoConstants.expoRuntimeVersion);\n addStringField(context, 'session_id', expoConstants.sessionId);\n addNumberField(context, 'status_bar_height', expoConstants.statusBarHeight);\n\n addExpoConfigFields(context, expoConstants);\n addEasConfigFields(context, expoConstants);\n\n return context;\n}\n\nfunction addStringField(\n context: ExpoConstantsContext,\n key: keyof ExpoConstantsContext,\n value: string | null | undefined,\n): void {\n if (typeof value === 'string' && value) {\n (context as Record<string, unknown>)[key] = value;\n }\n}\n\nfunction addBooleanField(\n context: ExpoConstantsContext,\n key: keyof ExpoConstantsContext,\n value: boolean | undefined,\n): void {\n if (typeof value === 'boolean') {\n (context as Record<string, unknown>)[key] = value;\n }\n}\n\nfunction addNumberField(\n context: ExpoConstantsContext,\n key: keyof ExpoConstantsContext,\n value: number | undefined,\n): void {\n if (typeof value === 'number') {\n (context as Record<string, unknown>)[key] = value;\n }\n}\n\nfunction addExpoConfigFields(context: ExpoConstantsContext, expoConstants: ExpoConstants): void {\n if (!expoConstants.expoConfig) {\n return;\n }\n\n addStringField(context, 'app_name', expoConstants.expoConfig.name);\n addStringField(context, 'app_slug', expoConstants.expoConfig.slug);\n addStringField(context, 'app_version', expoConstants.expoConfig.version);\n addStringField(context, 'expo_sdk_version', expoConstants.expoConfig.sdkVersion);\n}\n\nfunction addEasConfigFields(context: ExpoConstantsContext, expoConstants: ExpoConstants): void {\n if (!expoConstants.easConfig) {\n return;\n }\n\n addStringField(context, 'eas_project_id', expoConstants.easConfig.projectId);\n}\n\ntype ExpoConstantsContext = Partial<{\n execution_environment: string;\n app_ownership: string;\n debug_mode: boolean;\n expo_version: string;\n expo_runtime_version: string;\n session_id: string;\n status_bar_height: number;\n app_name: string;\n app_slug: string;\n app_version: string;\n expo_sdk_version?: string;\n eas_project_id: string;\n}>;\n"]}
1
+ {"version":3,"file":"expoconstants.js","sourceRoot":"","sources":["../../../src/js/integrations/expoconstants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAE3D,4CAA4C;AAC5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAgB,EAAE;IACxD,IAAI,2BAA6D,CAAC;IAElE,SAAS,YAAY,CAAC,KAAY;QAChC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YACd,OAAO,KAAK,CAAC;QACf,CAAC;QAED,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;QACtC,KAAK,CAAC,QAAQ,CAAC,0BAA0B,CAAC,qBACrC,6BAA6B,EAAE,CACnC,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,SAAS,6BAA6B;QACpC,IAAI,2BAA2B,EAAE,CAAC;YAChC,OAAO,2BAA2B,CAAC;QACrC,CAAC;QAED,OAAO,CAAC,2BAA2B,GAAG,uBAAuB,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAyB,EAAE,CAAC;IAEzC,cAAc,CAAC,OAAO,EAAE,uBAAuB,EAAE,aAAa,CAAC,o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AC,UAAU,EAAE,CAAC;QAC9B,OAAO;IACT,CAAC;IAED,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACnE,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACnE,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACzE,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,kBAAkB,CAAC,OAA6B,EAAE,aAA4B;IACrF,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;QAC7B,OAAO;IACT,CAAC;IAED,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import type { Event, Integration } from '@sentry/core';\nimport { isExpo } from '../utils/environment';\nimport type { ExpoConstants } from '../utils/expoglobalobject';\nimport { getExpoConstants } from '../utils/expomodules';\n\nconst INTEGRATION_NAME = 'ExpoConstants';\n\nexport const EXPO_CONSTANTS_CONTEXT_KEY = 'expo_constants';\n\n/** Load Expo Constants as event context. */\nexport const expoConstantsIntegration = (): Integration => {\n let _expoConstantsContextCached: ExpoConstantsContext | undefined;\n\n function processEvent(event: Event): Event {\n if (!isExpo()) {\n return event;\n }\n\n event.contexts = event.contexts || {};\n event.contexts[EXPO_CONSTANTS_CONTEXT_KEY] = {\n ...getExpoConstantsContextCached(),\n };\n\n return event;\n }\n\n function getExpoConstantsContextCached(): ExpoConstantsContext {\n if (_expoConstantsContextCached) {\n return _expoConstantsContextCached;\n }\n\n return (_expoConstantsContextCached = getExpoConstantsContext());\n }\n\n return {\n name: INTEGRATION_NAME,\n processEvent,\n };\n};\n\n/**\n * @internal Exposed for testing purposes\n */\nexport function getExpoConstantsContext(): ExpoConstantsContext {\n const expoConstants = getExpoConstants();\n if (!expoConstants) {\n return {};\n }\n\n const context: ExpoConstantsContext = {};\n\n addStringField(context, 'execution_environment', expoConstants.executionEnvironment);\n addStringField(context, 'app_ownership', expoConstants.appOwnership);\n addBooleanField(context, 'debug_mode', expoConstants.debugMode);\n addStringField(context, 'expo_version', expoConstants.expoVersion);\n addStringField(context, 'expo_runtime_version', expoConstants.expoRuntimeVersion);\n addStringField(context, 'session_id', expoConstants.sessionId);\n addNumberField(context, 'status_bar_height', expoConstants.statusBarHeight);\n\n addExpoConfigFields(context, expoConstants);\n addEasConfigFields(context, expoConstants);\n\n return context;\n}\n\nfunction addStringField(\n context: ExpoConstantsContext,\n key: keyof ExpoConstantsContext,\n value: string | null | undefined,\n): void {\n if (typeof value === 'string' && value) {\n (context as Record<string, unknown>)[key] = value;\n }\n}\n\nfunction addBooleanField(\n context: ExpoConstantsContext,\n key: keyof ExpoConstantsContext,\n value: boolean | undefined,\n): void {\n if (typeof value === 'boolean') {\n (context as Record<string, unknown>)[key] = value;\n }\n}\n\nfunction addNumberField(\n context: ExpoConstantsContext,\n key: keyof ExpoConstantsContext,\n value: number | undefined,\n): void {\n if (typeof value === 'number') {\n (context as Record<string, unknown>)[key] = value;\n }\n}\n\nfunction addExpoConfigFields(context: ExpoConstantsContext, expoConstants: ExpoConstants): void {\n if (!expoConstants.expoConfig) {\n return;\n }\n\n addStringField(context, 'app_name', expoConstants.expoConfig.name);\n addStringField(context, 'app_slug', expoConstants.expoConfig.slug);\n addStringField(context, 'app_version', expoConstants.expoConfig.version);\n addStringField(context, 'expo_sdk_version', expoConstants.expoConfig.sdkVersion);\n}\n\nfunction addEasConfigFields(context: ExpoConstantsContext, expoConstants: ExpoConstants): void {\n if (!expoConstants.easConfig) {\n return;\n }\n\n addStringField(context, 'eas_project_id', expoConstants.easConfig.projectId);\n}\n\ntype ExpoConstantsContext = Partial<{\n execution_environment: string;\n app_ownership: string;\n debug_mode: boolean;\n expo_version: string;\n expo_runtime_version: string;\n session_id: string;\n status_bar_height: number;\n app_name: string;\n app_slug: string;\n app_version: string;\n expo_sdk_version?: string;\n eas_project_id: string;\n}>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"expocontext.js","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoE,MAAM,cAAc,CAAC;AAEvG,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAErD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAgB,EAAE;IACtD,IAAI,yBAAyD,CAAC;IAE9D,SAAS,KAAK,CAAC,MAAyB;QACtC,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;YAC1B,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE;gBACrC,OAAO;aACR;YAED,2BAA2B,EAAE,CAAC;YAC9B,2BAA2B,CAAC,MAAM,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,SAAS,2BAA2B;QAClC,IAAI,CAAC,MAAM,EAAE,IAAI,QAAQ,EAAE,EAAE;YAC3B,OAAO;SACR;QAED,MAAM,WAAW,GAAG,2BAA2B,EAAE,CAAC;QAElD,IAAI;YACF,uEAAuE;YACvE,MAAM,CAAC,UAAU,CAAC,uBAAuB,EAAE,WAAW,CAAC,CAAC;SACzD;QAAC,OAAO,KAAK,EAAE;YACd,KAAK,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;SAC3D;IACH,CAAC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K,CAAC,QAAQ,CAAC,EAAE,CAAE,CAAC;KAChE;AACH,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB;IAC3B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,UAAU;QAC3B,SAAS,EAAE,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,CAAA;QAChC,KAAK,EAAE,UAAU,CAAC,SAAS;QAC3B,YAAY,EAAE,UAAU,CAAC,YAAY;QACrC,WAAW,EAAE,UAAU,CAAC,WAAW;KACpC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB;IACvB,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,KAAK,EAAE,UAAU,CAAC,SAAS;QAC3B,OAAO,EAAE,UAAU,CAAC,SAAS;QAC7B,IAAI,EAAE,UAAU,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import { debug, type DeviceContext, type Event, type Integration, type OsContext } from '@sentry/core';\nimport type { ReactNativeClient } from '../client';\nimport { isExpo, isExpoGo } from '../utils/environment';\nimport { getExpoDevice, getExpoUpdates } from '../utils/expomodules';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'ExpoContext';\n\nexport const OTA_UPDATES_CONTEXT_KEY = 'ota_updates';\n\n/** Load device context from expo modules. */\nexport const expoContextIntegration = (): Integration => {\n let _expoUpdatesContextCached: ExpoUpdatesContext | undefined;\n\n function setup(client: ReactNativeClient): void {\n client.on('afterInit', () => {\n if (!client.getOptions().enableNative) {\n return;\n }\n\n setExpoUpdatesNativeContext();\n captureEmergencyLaunchEvent(client);\n });\n }\n\n function setExpoUpdatesNativeContext(): void {\n if (!isExpo() || isExpoGo()) {\n return;\n }\n\n const expoUpdates = getExpoUpdatesContextCached();\n\n try {\n // Ensures native errors and crashes have the same context as JS errors\n NATIVE.setContext(OTA_UPDATES_CONTEXT_KEY, expoUpdates);\n } catch (error) {\n debug.error('Error setting Expo updates context:', error);\n }\n }\n\n function captureEmergencyLaunchEvent(client: ReactNativeClient): void {\n if (!isExpo() || isExpoGo()) {\n return;\n }\n\n const updatesContext = getExpoUpdatesContextCached();\n if (!updatesContext.is_emergency_launch) {\n return;\n }\n\n const message = updatesContext.emergency_launch_reason\n ? `Expo Updates emergency launch: ${updatesContext.emergency_launch_reason}`\n : 'Expo Updates emergency launch';\n\n client.captureEvent({\n level: 'warning',\n message,\n tags: {\n 'expo.updates.emergency_launch': 'true',\n },\n });\n }\n\n function processEvent(event: Event): Event {\n if (!isExpo()) {\n return event;\n }\n\n addExpoGoContext(event);\n addExpoUpdatesContext(event);\n return event;\n }\n\n function addExpoUpdatesContext(event: Event): void {\n const updatesContext = getExpoUpdatesContextCached();\n\n event.contexts = event.contexts || {};\n event.contexts[OTA_UPDATES_CONTEXT_KEY] = {\n ...updatesContext,\n };\n\n addExpoUpdatesTags(event, updatesContext);\n }\n\n function getExpoUpdatesContextCached(): ExpoUpdatesContext {\n if (_expoUpdatesContextCached) {\n return _expoUpdatesContextCached;\n }\n\n return (_expoUpdatesContextCached = getExpoUpdatesContext());\n }\n\n return {\n name: INTEGRATION_NAME,\n setup,\n processEvent,\n };\n};\n\n/**\n * @internal Exposed for testing purposes\n */\nexport function getExpoUpdatesContext(): ExpoUpdatesContext {\n const expoUpdates = getExpoUpdates();\n if (!expoUpdates) {\n return {\n is_enabled: false,\n };\n }\n\n const updatesContext: ExpoUpdatesContext = {\n is_enabled: !!expoUpdates.isEnabled,\n is_embedded_launch: !!expoUpdates.isEmbeddedLaunch,\n is_emergency_launch: !!expoUpdates.isEmergencyLaunch,\n is_using_embedded_assets: !!expoUpdates.isUsingEmbeddedAssets,\n };\n\n if (typeof expoUpdates.updateId === 'string' && expoUpdates.updateId) {\n updatesContext.update_id = expoUpdates.updateId.toLowerCase();\n }\n if (typeof expoUpdates.channel === 'string' && expoUpdates.channel) {\n updatesContext.channel = expoUpdates.channel.toLowerCase();\n }\n if (typeof expoUpdates.runtimeVersion === 'string' && expoUpdates.runtimeVersion) {\n updatesContext.runtime_version = expoUpdates.runtimeVersion.toLowerCase();\n }\n if (typeof expoUpdates.checkAutomatically === 'string' && expoUpdates.checkAutomatically) {\n updatesContext.check_automatically = expoUpdates.checkAutomatically.toLowerCase();\n }\n if (typeof expoUpdates.emergencyLaunchReason === 'string' && expoUpdates.emergencyLaunchReason) {\n updatesContext.emergency_launch_reason = expoUpdates.emergencyLaunchReason;\n }\n if (typeof expoUpdates.launchDuration === 'number') {\n updatesContext.launch_duration = expoUpdates.launchDuration;\n }\n if (expoUpdates.createdAt instanceof Date) {\n updatesContext.created_at = expoUpdates.createdAt.toISOString();\n }\n return updatesContext;\n}\n\nfunction addExpoUpdatesTags(event: Event, updatesContext: ExpoUpdatesContext): void {\n event.tags = event.tags || {};\n\n if (updatesContext.update_id) {\n event.tags['expo.updates.update_id'] = updatesContext.update_id;\n }\n if (updatesContext.channel) {\n event.tags['expo.updates.channel'] = updatesContext.channel;\n }\n if (updatesContext.runtime_version) {\n event.tags['expo.updates.runtime_version'] = updatesContext.runtime_version;\n }\n}\n\nfunction addExpoGoContext(event: Event): void {\n if (!isExpoGo()) {\n return;\n }\n\n const expoDeviceContext = getExpoDeviceContext();\n if (expoDeviceContext) {\n event.contexts = event.contexts || {};\n event.contexts.device = { ...expoDeviceContext, ...event.contexts.device };\n }\n\n const expoOsContext = getExpoOsContext();\n if (expoOsContext) {\n event.contexts = event.contexts || {};\n event.contexts.os = { ...expoOsContext, ...event.contexts.os };\n }\n}\n\n/**\n * Returns the Expo Device context if present\n */\nfunction getExpoDeviceContext(): DeviceContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n name: expoDevice.deviceName,\n simulator: !expoDevice?.isDevice,\n model: expoDevice.modelName,\n manufacturer: expoDevice.manufacturer,\n memory_size: expoDevice.totalMemory,\n };\n}\n\n/**\n * Returns the Expo OS context if present\n */\nfunction getExpoOsContext(): OsContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n build: expoDevice.osBuildId,\n version: expoDevice.osVersion,\n name: expoDevice.osName,\n };\n}\n\ntype ExpoUpdatesContext = Partial<{\n is_enabled: boolean;\n is_embedded_launch: boolean;\n is_emergency_launch: boolean;\n is_using_embedded_assets: boolean;\n update_id: string;\n channel: string;\n runtime_version: string;\n check_automatically: string;\n emergency_launch_reason: string;\n launch_duration: number;\n created_at: string;\n}>;\n"]}
1
+ {"version":3,"file":"expocontext.js","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoE,MAAM,cAAc,CAAC;AAEvG,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAErD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAgB,EAAE;IACtD,IAAI,yBAAyD,CAAC;IAE9D,SAAS,KAAK,CAAC,MAAyB;QACtC,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;YAC1B,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE,CAAC;gBACtC,OAAO;YACT,CAAC;YAED,2BAA2B,EAAE,CAAC;YAC9B,2BAA2B,CAAC,MAAM,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC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AU,CAAC,SAAS;QAC3B,OAAO,EAAE,UAAU,CAAC,SAAS;QAC7B,IAAI,EAAE,UAAU,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import { debug, type DeviceContext, type Event, type Integration, type OsContext } from '@sentry/core';\nimport type { ReactNativeClient } from '../client';\nimport { isExpo, isExpoGo } from '../utils/environment';\nimport { getExpoDevice, getExpoUpdates } from '../utils/expomodules';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'ExpoContext';\n\nexport const OTA_UPDATES_CONTEXT_KEY = 'ota_updates';\n\n/** Load device context from expo modules. */\nexport const expoContextIntegration = (): Integration => {\n let _expoUpdatesContextCached: ExpoUpdatesContext | undefined;\n\n function setup(client: ReactNativeClient): void {\n client.on('afterInit', () => {\n if (!client.getOptions().enableNative) {\n return;\n }\n\n setExpoUpdatesNativeContext();\n captureEmergencyLaunchEvent(client);\n });\n }\n\n function setExpoUpdatesNativeContext(): void {\n if (!isExpo() || isExpoGo()) {\n return;\n }\n\n const expoUpdates = getExpoUpdatesContextCached();\n\n try {\n // Ensures native errors and crashes have the same context as JS errors\n NATIVE.setContext(OTA_UPDATES_CONTEXT_KEY, expoUpdates);\n } catch (error) {\n debug.error('Error setting Expo updates context:', error);\n }\n }\n\n function captureEmergencyLaunchEvent(client: ReactNativeClient): void {\n if (!isExpo() || isExpoGo()) {\n return;\n }\n\n const updatesContext = getExpoUpdatesContextCached();\n if (!updatesContext.is_emergency_launch) {\n return;\n }\n\n const message = updatesContext.emergency_launch_reason\n ? `Expo Updates emergency launch: ${updatesContext.emergency_launch_reason}`\n : 'Expo Updates emergency launch';\n\n client.captureEvent({\n level: 'warning',\n message,\n tags: {\n 'expo.updates.emergency_launch': 'true',\n },\n });\n }\n\n function processEvent(event: Event): Event {\n if (!isExpo()) {\n return event;\n }\n\n addExpoGoContext(event);\n addExpoUpdatesContext(event);\n return event;\n }\n\n function addExpoUpdatesContext(event: Event): void {\n const updatesContext = getExpoUpdatesContextCached();\n\n event.contexts = event.contexts || {};\n event.contexts[OTA_UPDATES_CONTEXT_KEY] = {\n ...updatesContext,\n };\n\n addExpoUpdatesTags(event, updatesContext);\n }\n\n function getExpoUpdatesContextCached(): ExpoUpdatesContext {\n if (_expoUpdatesContextCached) {\n return _expoUpdatesContextCached;\n }\n\n return (_expoUpdatesContextCached = getExpoUpdatesContext());\n }\n\n return {\n name: INTEGRATION_NAME,\n setup,\n processEvent,\n };\n};\n\n/**\n * @internal Exposed for testing purposes\n */\nexport function getExpoUpdatesContext(): ExpoUpdatesContext {\n const expoUpdates = getExpoUpdates();\n if (!expoUpdates) {\n return {\n is_enabled: false,\n };\n }\n\n const updatesContext: ExpoUpdatesContext = {\n is_enabled: !!expoUpdates.isEnabled,\n is_embedded_launch: !!expoUpdates.isEmbeddedLaunch,\n is_emergency_launch: !!expoUpdates.isEmergencyLaunch,\n is_using_embedded_assets: !!expoUpdates.isUsingEmbeddedAssets,\n };\n\n if (typeof expoUpdates.updateId === 'string' && expoUpdates.updateId) {\n updatesContext.update_id = expoUpdates.updateId.toLowerCase();\n }\n if (typeof expoUpdates.channel === 'string' && expoUpdates.channel) {\n updatesContext.channel = expoUpdates.channel.toLowerCase();\n }\n if (typeof expoUpdates.runtimeVersion === 'string' && expoUpdates.runtimeVersion) {\n updatesContext.runtime_version = expoUpdates.runtimeVersion.toLowerCase();\n }\n if (typeof expoUpdates.checkAutomatically === 'string' && expoUpdates.checkAutomatically) {\n updatesContext.check_automatically = expoUpdates.checkAutomatically.toLowerCase();\n }\n if (typeof expoUpdates.emergencyLaunchReason === 'string' && expoUpdates.emergencyLaunchReason) {\n updatesContext.emergency_launch_reason = expoUpdates.emergencyLaunchReason;\n }\n if (typeof expoUpdates.launchDuration === 'number') {\n updatesContext.launch_duration = expoUpdates.launchDuration;\n }\n if (expoUpdates.createdAt instanceof Date) {\n updatesContext.created_at = expoUpdates.createdAt.toISOString();\n }\n return updatesContext;\n}\n\nfunction addExpoUpdatesTags(event: Event, updatesContext: ExpoUpdatesContext): void {\n event.tags = event.tags || {};\n\n if (updatesContext.update_id) {\n event.tags['expo.updates.update_id'] = updatesContext.update_id;\n }\n if (updatesContext.channel) {\n event.tags['expo.updates.channel'] = updatesContext.channel;\n }\n if (updatesContext.runtime_version) {\n event.tags['expo.updates.runtime_version'] = updatesContext.runtime_version;\n }\n}\n\nfunction addExpoGoContext(event: Event): void {\n if (!isExpoGo()) {\n return;\n }\n\n const expoDeviceContext = getExpoDeviceContext();\n if (expoDeviceContext) {\n event.contexts = event.contexts || {};\n event.contexts.device = { ...expoDeviceContext, ...event.contexts.device };\n }\n\n const expoOsContext = getExpoOsContext();\n if (expoOsContext) {\n event.contexts = event.contexts || {};\n event.contexts.os = { ...expoOsContext, ...event.contexts.os };\n }\n}\n\n/**\n * Returns the Expo Device context if present\n */\nfunction getExpoDeviceContext(): DeviceContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n name: expoDevice.deviceName,\n simulator: !expoDevice?.isDevice,\n model: expoDevice.modelName,\n manufacturer: expoDevice.manufacturer,\n memory_size: expoDevice.totalMemory,\n };\n}\n\n/**\n * Returns the Expo OS context if present\n */\nfunction getExpoOsContext(): OsContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n build: expoDevice.osBuildId,\n version: expoDevice.osVersion,\n name: expoDevice.osName,\n };\n}\n\ntype ExpoUpdatesContext = Partial<{\n is_enabled: boolean;\n is_embedded_launch: boolean;\n is_emergency_launch: boolean;\n is_using_embedded_assets: boolean;\n update_id: string;\n channel: string;\n runtime_version: string;\n check_automatically: string;\n emergency_launch_reason: string;\n launch_duration: number;\n created_at: string;\n}>;\n"]}
@@ -12,6 +12,7 @@ export { screenshotIntegration } from './screenshot';
12
12
  export { viewHierarchyIntegration } from './viewhierarchy';
13
13
  export { expoContextIntegration } from './expocontext';
14
14
  export { expoConstantsIntegration } from './expoconstants';
15
+ export { expoUpdatesListenerIntegration } from './expoupdateslistener';
15
16
  export { spotlightIntegration } from './spotlight';
16
17
  export { mobileReplayIntegration } from '../replay/mobilereplay';
17
18
  export { feedbackIntegration } from '../feedback/integration';
@@ -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,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,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,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AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,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"}
@@ -12,6 +12,7 @@ export { screenshotIntegration } from './screenshot';
12
12
  export { viewHierarchyIntegration } from './viewhierarchy';
13
13
  export { expoContextIntegration } from './expocontext';
14
14
  export { expoConstantsIntegration } from './expoconstants';
15
+ export { expoUpdatesListenerIntegration } from './expoupdateslistener';
15
16
  export { spotlightIntegration } from './spotlight';
16
17
  export { mobileReplayIntegration } from '../replay/mobilereplay';
17
18
  export { feedbackIntegration } from '../feedback/integration';
@@ -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,wB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egration } 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 { expoConstantsIntegration } from './expoconstants';\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';\nexport { graphqlIntegration } from './graphql';\nexport { supabaseIntegration } from './supabase';\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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AAE,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;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,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 { expoConstantsIntegration } from './expoconstants';\nexport { expoUpdatesListenerIntegration } from './expoupdateslistener';\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';\nexport { graphqlIntegration } from './graphql';\nexport { supabaseIntegration } from './supabase';\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,38 @@
1
+ import { type Integration } from '@sentry/core';
2
+ /**
3
+ * Describes the state machine context from `expo-updates`.
4
+ * We define our own minimal type to avoid a hard dependency on `expo-updates`.
5
+ */
6
+ interface UpdatesNativeStateMachineContext {
7
+ isChecking: boolean;
8
+ isDownloading: boolean;
9
+ isUpdateAvailable: boolean;
10
+ isUpdatePending: boolean;
11
+ isRestarting: boolean;
12
+ latestManifest?: {
13
+ id?: string;
14
+ };
15
+ downloadedManifest?: {
16
+ id?: string;
17
+ };
18
+ rollback?: {
19
+ commitTime: string;
20
+ };
21
+ checkError?: Error;
22
+ downloadError?: Error;
23
+ }
24
+ /**
25
+ * Listens to Expo Updates native state machine changes and records
26
+ * breadcrumbs for meaningful transitions such as checking for updates,
27
+ * downloading updates, errors, rollbacks, and restarts.
28
+ */
29
+ export declare const expoUpdatesListenerIntegration: () => Integration;
30
+ /**
31
+ * Compares previous and current state machine contexts and emits
32
+ * breadcrumbs for meaningful transitions (falsy→truthy).
33
+ *
34
+ * @internal Exposed for testing purposes
35
+ */
36
+ export declare function handleStateChange(previous: Partial<UpdatesNativeStateMachineContext>, current: UpdatesNativeStateMachineContext): void;
37
+ export {};
38
+ //# sourceMappingURL=expoupdateslistener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expoupdateslistener.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/expoupdateslistener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,WAAW,EAAsB,MAAM,cAAc,CAAC;AAQ1F;;;GAGG;AACH,UAAU,gCAAgC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,kBAAkB,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,QAAQ,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC;CACvB;AAyFD;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,QAAO,WAwCjD,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,CAAC,gCAAgC,CAAC,EACnD,OAAO,EAAE,gCAAgC,GACxC,IAAI,CAWN"}
@@ -0,0 +1,130 @@
1
+ import { addBreadcrumb, debug } from '@sentry/core';
2
+ import { isExpo, isExpoGo } from '../utils/environment';
3
+ const INTEGRATION_NAME = 'ExpoUpdatesListener';
4
+ const BREADCRUMB_CATEGORY = 'expo.updates';
5
+ /**
6
+ * Tries to load `expo-updates` and retrieve exports needed by this integration.
7
+ * Returns `undefined` if `expo-updates` is not installed.
8
+ */
9
+ function getExpoUpdatesExports() {
10
+ try {
11
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
12
+ const expoUpdates = require('expo-updates');
13
+ if (typeof expoUpdates.addUpdatesStateChangeListener === 'function') {
14
+ return expoUpdates;
15
+ }
16
+ }
17
+ catch (_) {
18
+ // that happens when expo-updates is not installed
19
+ }
20
+ return undefined;
21
+ }
22
+ const STATE_TRANSITIONS = [
23
+ { field: 'isChecking', message: 'Checking for update', level: 'info' },
24
+ {
25
+ field: 'isUpdateAvailable',
26
+ message: 'Update available',
27
+ level: 'info',
28
+ getData: ctx => {
29
+ var _a;
30
+ const updateId = (_a = ctx.latestManifest) === null || _a === void 0 ? void 0 : _a.id;
31
+ return updateId ? { updateId } : undefined;
32
+ },
33
+ },
34
+ { field: 'isDownloading', message: 'Downloading update', level: 'info' },
35
+ {
36
+ field: 'isUpdatePending',
37
+ message: 'Update downloaded',
38
+ level: 'info',
39
+ getData: ctx => {
40
+ var _a;
41
+ const updateId = (_a = ctx.downloadedManifest) === null || _a === void 0 ? void 0 : _a.id;
42
+ return updateId ? { updateId } : undefined;
43
+ },
44
+ },
45
+ {
46
+ field: 'checkError',
47
+ message: 'Update check failed',
48
+ level: 'error',
49
+ getData: ctx => ({
50
+ error: ctx.checkError.message || String(ctx.checkError),
51
+ }),
52
+ },
53
+ {
54
+ field: 'downloadError',
55
+ message: 'Update download failed',
56
+ level: 'error',
57
+ getData: ctx => ({
58
+ error: ctx.downloadError.message || String(ctx.downloadError),
59
+ }),
60
+ },
61
+ {
62
+ field: 'rollback',
63
+ message: 'Rollback directive received',
64
+ level: 'warning',
65
+ getData: ctx => ({
66
+ commitTime: ctx.rollback.commitTime,
67
+ }),
68
+ },
69
+ { field: 'isRestarting', message: 'Restarting for update', level: 'info' },
70
+ ];
71
+ /**
72
+ * Listens to Expo Updates native state machine changes and records
73
+ * breadcrumbs for meaningful transitions such as checking for updates,
74
+ * downloading updates, errors, rollbacks, and restarts.
75
+ */
76
+ export const expoUpdatesListenerIntegration = () => {
77
+ let subscription;
78
+ function setup(client) {
79
+ client.on('afterInit', () => {
80
+ var _a;
81
+ if (!isExpo() || isExpoGo()) {
82
+ return;
83
+ }
84
+ const expoUpdates = getExpoUpdatesExports();
85
+ if (!expoUpdates) {
86
+ debug.log('[ExpoUpdatesListener] expo-updates is not available, skipping.');
87
+ return;
88
+ }
89
+ // Remove any previous subscription to prevent duplicate breadcrumbs
90
+ // if Sentry.init() is called multiple times.
91
+ subscription === null || subscription === void 0 ? void 0 : subscription.remove();
92
+ // Seed with the current state so that the first event does not
93
+ // generate spurious breadcrumbs for already-truthy fields.
94
+ let previousContext = (_a = expoUpdates.latestContext) !== null && _a !== void 0 ? _a : {};
95
+ subscription = expoUpdates.addUpdatesStateChangeListener((event) => {
96
+ const ctx = event.context;
97
+ handleStateChange(previousContext, ctx);
98
+ previousContext = ctx;
99
+ });
100
+ });
101
+ client.on('close', () => {
102
+ subscription === null || subscription === void 0 ? void 0 : subscription.remove();
103
+ subscription = undefined;
104
+ });
105
+ }
106
+ return {
107
+ name: INTEGRATION_NAME,
108
+ setup,
109
+ };
110
+ };
111
+ /**
112
+ * Compares previous and current state machine contexts and emits
113
+ * breadcrumbs for meaningful transitions (falsy→truthy).
114
+ *
115
+ * @internal Exposed for testing purposes
116
+ */
117
+ export function handleStateChange(previous, current) {
118
+ var _a;
119
+ for (const transition of STATE_TRANSITIONS) {
120
+ if (!previous[transition.field] && current[transition.field]) {
121
+ addBreadcrumb({
122
+ category: BREADCRUMB_CATEGORY,
123
+ message: transition.message,
124
+ level: transition.level,
125
+ data: (_a = transition.getData) === null || _a === void 0 ? void 0 : _a.call(transition, current),
126
+ });
127
+ }
128
+ }
129
+ }
130
+ //# sourceMappingURL=expoupdateslistener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expoupdateslistener.js","sourceRoot":"","sources":["../../../src/js/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,CAAC;AACH,CAAC","sourcesContent":["import { addBreadcrumb, debug, type Integration, type SeverityLevel } from '@sentry/core';\nimport type { ReactNativeClient } from '../client';\nimport { isExpo, isExpoGo } from '../utils/environment';\n\nconst INTEGRATION_NAME = 'ExpoUpdatesListener';\n\nconst BREADCRUMB_CATEGORY = 'expo.updates';\n\n/**\n * Describes the state machine context from `expo-updates`.\n * We define our own minimal type to avoid a hard dependency on `expo-updates`.\n */\ninterface UpdatesNativeStateMachineContext {\n isChecking: boolean;\n isDownloading: boolean;\n isUpdateAvailable: boolean;\n isUpdatePending: boolean;\n isRestarting: boolean;\n latestManifest?: { id?: string };\n downloadedManifest?: { id?: string };\n rollback?: { commitTime: string };\n checkError?: Error;\n downloadError?: Error;\n}\n\ninterface UpdatesNativeStateChangeEvent {\n context: UpdatesNativeStateMachineContext;\n}\n\ninterface UpdatesStateChangeSubscription {\n remove(): void;\n}\n\ninterface ExpoUpdatesExports {\n addUpdatesStateChangeListener: (\n listener: (event: UpdatesNativeStateChangeEvent) => void,\n ) => UpdatesStateChangeSubscription;\n latestContext: UpdatesNativeStateMachineContext;\n}\n\n/**\n * Tries to load `expo-updates` and retrieve exports needed by this integration.\n * Returns `undefined` if `expo-updates` is not installed.\n */\nfunction getExpoUpdatesExports(): ExpoUpdatesExports | undefined {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const expoUpdates = require('expo-updates') as Partial<ExpoUpdatesExports>;\n if (typeof expoUpdates.addUpdatesStateChangeListener === 'function') {\n return expoUpdates as ExpoUpdatesExports;\n }\n } catch (_) {\n // that happens when expo-updates is not installed\n }\n return undefined;\n}\n\ninterface StateTransition {\n field: keyof UpdatesNativeStateMachineContext;\n message: string;\n level: SeverityLevel;\n getData?: (ctx: UpdatesNativeStateMachineContext) => Record<string, unknown> | undefined;\n}\n\nconst STATE_TRANSITIONS: StateTransition[] = [\n { field: 'isChecking', message: 'Checking for update', level: 'info' },\n {\n field: 'isUpdateAvailable',\n message: 'Update available',\n level: 'info',\n getData: ctx => {\n const updateId = ctx.latestManifest?.id;\n return updateId ? { updateId } : undefined;\n },\n },\n { field: 'isDownloading', message: 'Downloading update', level: 'info' },\n {\n field: 'isUpdatePending',\n message: 'Update downloaded',\n level: 'info',\n getData: ctx => {\n const updateId = ctx.downloadedManifest?.id;\n return updateId ? { updateId } : undefined;\n },\n },\n {\n field: 'checkError',\n message: 'Update check failed',\n level: 'error',\n getData: ctx => ({\n error: (ctx.checkError as Error).message || String(ctx.checkError),\n }),\n },\n {\n field: 'downloadError',\n message: 'Update download failed',\n level: 'error',\n getData: ctx => ({\n error: (ctx.downloadError as Error).message || String(ctx.downloadError),\n }),\n },\n {\n field: 'rollback',\n message: 'Rollback directive received',\n level: 'warning',\n getData: ctx => ({\n commitTime: ctx.rollback!.commitTime,\n }),\n },\n { field: 'isRestarting', message: 'Restarting for update', level: 'info' },\n];\n\n/**\n * Listens to Expo Updates native state machine changes and records\n * breadcrumbs for meaningful transitions such as checking for updates,\n * downloading updates, errors, rollbacks, and restarts.\n */\nexport const expoUpdatesListenerIntegration = (): Integration => {\n let subscription: UpdatesStateChangeSubscription | undefined;\n\n function setup(client: ReactNativeClient): void {\n client.on('afterInit', () => {\n if (!isExpo() || isExpoGo()) {\n return;\n }\n\n const expoUpdates = getExpoUpdatesExports();\n if (!expoUpdates) {\n debug.log('[ExpoUpdatesListener] expo-updates is not available, skipping.');\n return;\n }\n\n // Remove any previous subscription to prevent duplicate breadcrumbs\n // if Sentry.init() is called multiple times.\n subscription?.remove();\n\n // Seed with the current state so that the first event does not\n // generate spurious breadcrumbs for already-truthy fields.\n let previousContext: Partial<UpdatesNativeStateMachineContext> = expoUpdates.latestContext ?? {};\n\n subscription = expoUpdates.addUpdatesStateChangeListener((event: UpdatesNativeStateChangeEvent) => {\n const ctx = event.context;\n handleStateChange(previousContext, ctx);\n previousContext = ctx;\n });\n });\n\n client.on('close', () => {\n subscription?.remove();\n subscription = undefined;\n });\n }\n\n return {\n name: INTEGRATION_NAME,\n setup,\n };\n};\n\n/**\n * Compares previous and current state machine contexts and emits\n * breadcrumbs for meaningful transitions (falsy→truthy).\n *\n * @internal Exposed for testing purposes\n */\nexport function handleStateChange(\n previous: Partial<UpdatesNativeStateMachineContext>,\n current: UpdatesNativeStateMachineContext,\n): void {\n for (const transition of STATE_TRANSITIONS) {\n if (!previous[transition.field] && current[transition.field]) {\n addBreadcrumb({\n category: BREADCRUMB_CATEGORY,\n message: transition.message,\n level: transition.level,\n data: transition.getData?.(current),\n });\n }\n }\n}\n"]}
@@ -41,8 +41,8 @@ function setLogAttribute(logAttributes, key, value, setEvenIfPresent = true) {
41
41
  }
42
42
  }
43
43
  function cacheLogContext() {
44
- var _a, _b, _c, _d, _e, _f;
45
44
  return __awaiter(this, void 0, void 0, function* () {
45
+ var _a, _b, _c, _d, _e, _f;
46
46
  try {
47
47
  const response = yield NATIVE.fetchNativeLogAttributes();
48
48
  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) && {