@sentry/react-native 7.10.0 → 7.12.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 (70) hide show
  1. package/android/libs/replay-stubs.jar +0 -0
  2. package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +33 -16
  3. package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
  4. package/android/src/newarch/java/io/sentry/react/RNSentryModule.java +10 -0
  5. package/android/src/oldarch/java/io/sentry/react/RNSentryModule.java +15 -0
  6. package/dist/js/NativeRNSentry.d.ts +2 -0
  7. package/dist/js/NativeRNSentry.d.ts.map +1 -1
  8. package/dist/js/NativeRNSentry.js.map +1 -1
  9. package/dist/js/client.d.ts.map +1 -1
  10. package/dist/js/client.js +2 -2
  11. package/dist/js/client.js.map +1 -1
  12. package/dist/js/index.d.ts +2 -2
  13. package/dist/js/index.d.ts.map +1 -1
  14. package/dist/js/index.js +1 -1
  15. package/dist/js/index.js.map +1 -1
  16. package/dist/js/integrations/logEnricherIntegration.js +43 -3
  17. package/dist/js/integrations/logEnricherIntegration.js.map +1 -1
  18. package/dist/js/options.d.ts +18 -10
  19. package/dist/js/options.d.ts.map +1 -1
  20. package/dist/js/options.js.map +1 -1
  21. package/dist/js/scopeSync.d.ts.map +1 -1
  22. package/dist/js/scopeSync.js +27 -0
  23. package/dist/js/scopeSync.js.map +1 -1
  24. package/dist/js/touchevents.d.ts +8 -0
  25. package/dist/js/touchevents.d.ts.map +1 -1
  26. package/dist/js/touchevents.js +33 -1
  27. package/dist/js/touchevents.js.map +1 -1
  28. package/dist/js/tracing/expoRouter.d.ts +25 -0
  29. package/dist/js/tracing/expoRouter.d.ts.map +1 -0
  30. package/dist/js/tracing/expoRouter.js +73 -0
  31. package/dist/js/tracing/expoRouter.js.map +1 -0
  32. package/dist/js/tracing/index.d.ts +2 -0
  33. package/dist/js/tracing/index.d.ts.map +1 -1
  34. package/dist/js/tracing/index.js +1 -0
  35. package/dist/js/tracing/index.js.map +1 -1
  36. package/dist/js/tracing/origin.d.ts +1 -0
  37. package/dist/js/tracing/origin.d.ts.map +1 -1
  38. package/dist/js/tracing/origin.js +1 -0
  39. package/dist/js/tracing/origin.js.map +1 -1
  40. package/dist/js/tracing/reactnavigation.d.ts +9 -1
  41. package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
  42. package/dist/js/tracing/reactnavigation.js +30 -1
  43. package/dist/js/tracing/reactnavigation.js.map +1 -1
  44. package/dist/js/version.d.ts +1 -1
  45. package/dist/js/version.js +1 -1
  46. package/dist/js/version.js.map +1 -1
  47. package/dist/js/wrapper.d.ts +6 -2
  48. package/dist/js/wrapper.d.ts.map +1 -1
  49. package/dist/js/wrapper.js +38 -4
  50. package/dist/js/wrapper.js.map +1 -1
  51. package/ios/RNSentry.mm +16 -0
  52. package/ios/RNSentryExperimentalOptions.h +8 -0
  53. package/ios/RNSentryExperimentalOptions.m +42 -0
  54. package/ios/RNSentryVersion.m +1 -1
  55. package/ios/SentrySDKWrapper.m +7 -0
  56. package/package.json +9 -9
  57. package/plugin/build/withSentryIOS.js +4 -0
  58. package/scripts/sentry-xcode-debug-files.sh +9 -3
  59. package/scripts/sentry-xcode.sh +8 -3
  60. package/src/js/NativeRNSentry.ts +2 -0
  61. package/ts3.8/dist/js/NativeRNSentry.d.ts +2 -0
  62. package/ts3.8/dist/js/index.d.ts +2 -2
  63. package/ts3.8/dist/js/options.d.ts +18 -10
  64. package/ts3.8/dist/js/touchevents.d.ts +8 -0
  65. package/ts3.8/dist/js/tracing/expoRouter.d.ts +25 -0
  66. package/ts3.8/dist/js/tracing/index.d.ts +2 -0
  67. package/ts3.8/dist/js/tracing/origin.d.ts +1 -0
  68. package/ts3.8/dist/js/tracing/reactnavigation.d.ts +9 -1
  69. package/ts3.8/dist/js/version.d.ts +1 -1
  70. package/ts3.8/dist/js/wrapper.d.ts +6 -2
@@ -1 +1 @@
1
- {"version":3,"file":"reactnavigation.js","sourceRoot":"","sources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,EAAE;YAC7C,YAAY,CAAC,kBAAkB,CAAC,CAAC;YACjC,kBAAkB,GAAG,SAAS,CAAC;SAChC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,aAAa;QACb,2BAA2B;QAC3B,OAAO,EAAE;YACP,oBAAoB;YACpB,0BAA0B;YAC1B,qCAAqC;YACrC,4CAA4C;YAC5C,uBAAuB;YACvB,+BAA+B;SAChC;KACF,CAAC;AACJ,CAAC,CAAC;AAqBF;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAC3C,MAAc;IAEd,OAAO,MAAM,CAAC,oBAAoB,CAAgD,gBAAgB,CAAC,CAAC;AACtG,CAAC","sourcesContent":["/* eslint-disable max-lines */\nimport type { Client, Integration, Span } from '@sentry/core';\nimport {\n addBreadcrumb,\n debug,\n getClient,\n isPlainObject,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_OK,\n spanToJSON,\n startInactiveSpan,\n timestampInSeconds,\n} from '@sentry/core';\nimport { getAppRegistryIntegration } from '../integrations/appRegistry';\nimport { isSentrySpan } from '../utils/span';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport type { UnsafeAction } from '../vendor/react-navigation/types';\nimport { NATIVE } from '../wrapper';\nimport { ignoreEmptyBackNavigation, ignoreEmptyRouteChangeTransactions } from './onSpanEndUtils';\nimport { SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION } from './origin';\nimport type { ReactNativeTracingIntegration } from './reactnativetracing';\nimport { getReactNativeTracingIntegration } from './reactnativetracing';\nimport { SEMANTIC_ATTRIBUTE_NAVIGATION_ACTION_TYPE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from './semanticAttributes';\nimport {\n DEFAULT_NAVIGATION_SPAN_NAME,\n defaultIdleOptions,\n getDefaultIdleNavigationSpanOptions,\n startIdleNavigationSpan as startGenericIdleNavigationSpan,\n} from './span';\nimport { addTimeToInitialDisplayFallback } from './timeToDisplayFallback';\n\nexport const INTEGRATION_NAME = 'ReactNavigation';\n\nconst NAVIGATION_HISTORY_MAX_SIZE = 200;\n\n/**\n * Builds a full path from the navigation state by traversing nested navigators.\n * For example, with nested navigators: \"Home/Settings/Profile\"\n */\nfunction getPathFromState(state?: NavigationState): string | undefined {\n if (!state) {\n return undefined;\n }\n\n const routeNames: string[] = [];\n let currentState: NavigationState | undefined = state;\n\n while (currentState) {\n const index: number = currentState.index ?? 0;\n const route: NavigationRoute | undefined = currentState.routes[index];\n if (route?.name) {\n routeNames.push(route.name);\n }\n currentState = route?.state;\n }\n\n return routeNames.length > 0 ? routeNames.join('/') : undefined;\n}\n\ninterface ReactNavigationIntegrationOptions {\n /**\n * How long the instrumentation will wait for the route to mount after a change has been initiated,\n * before the transaction is discarded.\n *\n * @default 1_000 (ms)\n */\n routeChangeTimeoutMs: number;\n\n /**\n * Time to initial display measures the time it takes from\n * navigation dispatch to the render of the first frame of the new screen.\n *\n * @default false\n */\n enableTimeToInitialDisplay: boolean;\n\n /**\n * Does not sample transactions that are from routes that have been seen any more and don't have any spans.\n * This removes a lot of the clutter as most back navigation transactions are now ignored.\n *\n * @default true\n */\n ignoreEmptyBackNavigationTransactions: boolean;\n\n /**\n * Enabled measuring Time to Initial Display for routes that are already loaded in memory.\n * (a.k.a., Routes that the navigation integration has already seen.)\n *\n * @default false\n */\n enableTimeToInitialDisplayForPreloadedRoutes: boolean;\n\n /**\n * Whether to use the dispatched action data to populate the transaction metadata.\n *\n * @default false\n */\n useDispatchedActionData: boolean;\n\n /**\n * Whether to use the full paths for navigation routes.\n *\n * @default false\n */\n useFullPathsForNavigationRoutes: boolean;\n}\n\n/**\n * Instrumentation for React-Navigation V5 and above. See docs or sample app for usage.\n *\n * How this works:\n * - `_onDispatch` is called every time a dispatch happens and sets an IdleTransaction on the scope without any route context.\n * - `_onStateChange` is then called AFTER the state change happens due to a dispatch and sets the route context onto the active transaction.\n * - If `_onStateChange` isn't called within `STATE_CHANGE_TIMEOUT_DURATION` of the dispatch, then the transaction is not sampled and finished.\n */\nexport const reactNavigationIntegration = ({\n routeChangeTimeoutMs = 1_000,\n enableTimeToInitialDisplay = false,\n ignoreEmptyBackNavigationTransactions = true,\n enableTimeToInitialDisplayForPreloadedRoutes = false,\n useDispatchedActionData = false,\n useFullPathsForNavigationRoutes = false,\n}: Partial<ReactNavigationIntegrationOptions> = {}): Integration & {\n /**\n * Pass the ref to the navigation container to register it to the instrumentation\n * @param navigationContainerRef Ref to a `NavigationContainer`\n */\n registerNavigationContainer: (navigationContainerRef: unknown) => void;\n options: ReactNavigationIntegrationOptions;\n} => {\n let navigationContainer: NavigationContainer | undefined;\n\n let tracing: ReactNativeTracingIntegration | undefined;\n let idleSpanOptions: Parameters<typeof startGenericIdleNavigationSpan>[1] = defaultIdleOptions;\n let latestRoute: NavigationRoute | undefined;\n\n let latestNavigationSpan: Span | undefined;\n let navigationProcessingSpan: Span | undefined;\n\n let initialStateHandled: boolean = false;\n let stateChangeTimeout: ReturnType<typeof setTimeout> | undefined;\n let recentRouteKeys: string[] = [];\n\n if (enableTimeToInitialDisplay) {\n NATIVE.initNativeReactNavigationNewFrameTracking().catch((reason: unknown) => {\n debug.error(`${INTEGRATION_NAME} Failed to initialize native new frame tracking: ${reason}`);\n });\n }\n\n /**\n * Set the initial state and start initial navigation span for the current screen.\n */\n const afterAllSetup = (client: Client): void => {\n tracing = getReactNativeTracingIntegration(client);\n if (tracing) {\n idleSpanOptions = {\n finalTimeout: tracing.options.finalTimeoutMs,\n idleTimeout: tracing.options.idleTimeoutMs,\n };\n }\n\n if (initialStateHandled) {\n // We create an initial state here to ensure a transaction gets created before the first route mounts.\n // This assumes that the Sentry.init() call is made before the first route mounts.\n // If this is not the case, the first transaction will be nameless 'Route Changed'\n return undefined;\n }\n\n getAppRegistryIntegration(client)?.onRunApplication(() => {\n if (initialStateHandled) {\n // To avoid conflict with the initial transaction we check if it was already handled.\n // This ensures runApplication calls after the initial start are correctly traced.\n // This is used for example when Activity is (re)started on Android.\n debug.log('[ReactNavigationIntegration] Starting new idle navigation span based on runApplication call.');\n startIdleNavigationSpan(undefined, true);\n }\n });\n\n startIdleNavigationSpan();\n\n if (!navigationContainer) {\n // This is expected as navigation container is registered after the root component is mounted.\n return undefined;\n }\n\n // Navigation container already registered, just populate with route state\n updateLatestNavigationSpanWithCurrentRoute();\n initialStateHandled = true;\n };\n\n const registerNavigationContainer = (maybeNewNavigationContainer: unknown): void => {\n if (RN_GLOBAL_OBJ.__sentry_rn_v5_registered) {\n debug.log(`${INTEGRATION_NAME} Instrumentation already exists, but registering again...`);\n // In the past we have not allowed re-registering the navigation container to avoid unexpected behavior.\n // But this doesn't work for Android and re-recreating application main activity.\n // Where new navigation container is created and the old one is discarded. We need to re-register to\n // trace the new navigation container navigation.\n }\n\n let newNavigationContainer: NavigationContainer | undefined;\n if (isPlainObject(maybeNewNavigationContainer) && 'current' in maybeNewNavigationContainer) {\n newNavigationContainer = maybeNewNavigationContainer.current as NavigationContainer;\n } else {\n newNavigationContainer = maybeNewNavigationContainer as NavigationContainer;\n }\n\n if (navigationContainer === newNavigationContainer) {\n debug.log(`${INTEGRATION_NAME} Navigation container ref is the same as the one already registered.`);\n return;\n }\n navigationContainer = newNavigationContainer;\n\n if (!navigationContainer) {\n debug.warn(`${INTEGRATION_NAME} Received invalid navigation container ref!`);\n return undefined;\n }\n\n // This action is emitted on every dispatch\n navigationContainer.addListener('__unsafe_action__', startIdleNavigationSpan);\n navigationContainer.addListener('state', updateLatestNavigationSpanWithCurrentRoute);\n RN_GLOBAL_OBJ.__sentry_rn_v5_registered = true;\n\n if (initialStateHandled) {\n return undefined;\n }\n\n if (!latestNavigationSpan) {\n debug.log(`${INTEGRATION_NAME} Navigation container registered, but integration has not been setup yet.`);\n return undefined;\n }\n\n // Navigation Container is registered after the first navigation\n // Initial navigation span was started, after integration setup,\n // so now we populate it with the current route.\n updateLatestNavigationSpanWithCurrentRoute();\n initialStateHandled = true;\n };\n\n /**\n * To be called on every React-Navigation action dispatch.\n * It does not name the transaction or populate it with route information. Instead, it waits for the state to fully change\n * and gets the route information from there, @see updateLatestNavigationSpanWithCurrentRoute\n *\n * @param unknownEvent - The event object that contains navigation action data\n * @param isAppRestart - Whether this span is being started due to an app restart rather than a normal navigation action\n */\n const startIdleNavigationSpan = (unknownEvent?: unknown, isAppRestart = false): void => {\n const event = unknownEvent as UnsafeAction | undefined;\n if (useDispatchedActionData && event?.data.noop) {\n debug.log(`${INTEGRATION_NAME} Navigation action is a noop, not starting navigation span.`);\n return;\n }\n\n const navigationActionType = useDispatchedActionData ? event?.data.action.type : undefined;\n if (\n useDispatchedActionData &&\n navigationActionType &&\n [\n // Process common actions\n 'PRELOAD',\n 'SET_PARAMS',\n // Drawer actions\n 'OPEN_DRAWER',\n 'CLOSE_DRAWER',\n 'TOGGLE_DRAWER',\n ].includes(navigationActionType)\n ) {\n debug.log(`${INTEGRATION_NAME} Navigation action is ${navigationActionType}, not starting navigation span.`);\n return;\n }\n\n if (latestNavigationSpan) {\n debug.log(`${INTEGRATION_NAME} A transaction was detected that turned out to be a noop, discarding.`);\n _discardLatestTransaction();\n clearStateChangeTimeout();\n }\n\n latestNavigationSpan = startGenericIdleNavigationSpan(\n tracing?.options.beforeStartSpan\n ? tracing.options.beforeStartSpan(getDefaultIdleNavigationSpanOptions())\n : getDefaultIdleNavigationSpanOptions(),\n { ...idleSpanOptions, isAppRestart },\n );\n latestNavigationSpan?.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION);\n latestNavigationSpan?.setAttribute(SEMANTIC_ATTRIBUTE_NAVIGATION_ACTION_TYPE, navigationActionType);\n if (ignoreEmptyBackNavigationTransactions) {\n ignoreEmptyBackNavigation(getClient(), latestNavigationSpan);\n }\n // Always discard transactions that never receive route information\n const spanToCheck = latestNavigationSpan;\n ignoreEmptyRouteChangeTransactions(\n getClient(),\n spanToCheck,\n DEFAULT_NAVIGATION_SPAN_NAME,\n () => latestNavigationSpan === spanToCheck,\n );\n\n if (enableTimeToInitialDisplay && latestNavigationSpan) {\n NATIVE.setActiveSpanId(latestNavigationSpan.spanContext().spanId);\n navigationProcessingSpan = startInactiveSpan({\n op: 'navigation.processing',\n name: 'Navigation dispatch to navigation cancelled or screen mounted',\n startTime: spanToJSON(latestNavigationSpan).start_timestamp,\n });\n navigationProcessingSpan.setAttribute(\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION,\n );\n }\n\n stateChangeTimeout = setTimeout(_discardLatestTransaction, routeChangeTimeoutMs);\n };\n\n /**\n * To be called AFTER the state has been changed to populate the transaction with the current route.\n */\n const updateLatestNavigationSpanWithCurrentRoute = (): void => {\n const stateChangedTimestamp = timestampInSeconds();\n const previousRoute = latestRoute;\n\n if (!navigationContainer) {\n debug.warn(`${INTEGRATION_NAME} Missing navigation container ref. Route transactions will not be sent.`);\n return undefined;\n }\n\n const route = navigationContainer.getCurrentRoute();\n if (!route) {\n debug.log(`[${INTEGRATION_NAME}] Navigation state changed, but no route is rendered.`);\n return undefined;\n }\n\n if (!latestNavigationSpan) {\n debug.log(\n `[${INTEGRATION_NAME}] Navigation state changed, but navigation transaction was not started on dispatch.`,\n );\n return undefined;\n }\n\n addTimeToInitialDisplayFallback(latestNavigationSpan.spanContext().spanId, NATIVE.getNewScreenTimeToDisplay());\n\n if (previousRoute && previousRoute.key === route.key) {\n debug.log(`[${INTEGRATION_NAME}] Navigation state changed, but route is the same as previous.`);\n pushRecentRouteKey(route.key);\n latestRoute = route;\n\n // Clear the latest transaction as it has been handled.\n latestNavigationSpan = undefined;\n return undefined;\n }\n\n const routeHasBeenSeen = recentRouteKeys.includes(route.key);\n\n // Get the full navigation path for nested navigators\n let routeName = route.name;\n if (useFullPathsForNavigationRoutes) {\n const navigationState = navigationContainer.getState();\n routeName = getPathFromState(navigationState) || route.name;\n }\n\n navigationProcessingSpan?.updateName(`Navigation dispatch to screen ${routeName} mounted`);\n navigationProcessingSpan?.setStatus({ code: SPAN_STATUS_OK });\n navigationProcessingSpan?.end(stateChangedTimestamp);\n navigationProcessingSpan = undefined;\n\n if (spanToJSON(latestNavigationSpan).description === DEFAULT_NAVIGATION_SPAN_NAME) {\n latestNavigationSpan.updateName(routeName);\n }\n latestNavigationSpan.setAttributes({\n 'route.name': routeName,\n 'route.key': route.key,\n // TODO: filter PII params instead of dropping them all\n // 'route.params': {},\n 'route.has_been_seen': routeHasBeenSeen,\n 'previous_route.name': previousRoute?.name,\n 'previous_route.key': previousRoute?.key,\n // TODO: filter PII params instead of dropping them all\n // 'previous_route.params': {},\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n });\n\n // Clear the timeout so the transaction does not get cancelled.\n clearStateChangeTimeout();\n\n addBreadcrumb({\n category: 'navigation',\n type: 'navigation',\n message: `Navigation to ${routeName}`,\n data: {\n from: previousRoute?.name,\n to: routeName,\n },\n });\n\n tracing?.setCurrentRoute(routeName);\n\n pushRecentRouteKey(route.key);\n if (useFullPathsForNavigationRoutes) {\n latestRoute = { ...route, name: routeName };\n } else {\n latestRoute = route;\n }\n // Clear the latest transaction as it has been handled.\n latestNavigationSpan = undefined;\n };\n\n /** Pushes a recent route key, and removes earlier routes when there is greater than the max length */\n const pushRecentRouteKey = (key: string): void => {\n recentRouteKeys.push(key);\n\n if (recentRouteKeys.length > NAVIGATION_HISTORY_MAX_SIZE) {\n recentRouteKeys = recentRouteKeys.slice(recentRouteKeys.length - NAVIGATION_HISTORY_MAX_SIZE);\n }\n };\n\n /** Cancels the latest transaction so it does not get sent to Sentry. */\n const _discardLatestTransaction = (): void => {\n if (latestNavigationSpan) {\n if (isSentrySpan(latestNavigationSpan)) {\n latestNavigationSpan['_sampled'] = false;\n }\n // TODO: What if it's not SentrySpan?\n latestNavigationSpan.end();\n latestNavigationSpan = undefined;\n }\n if (navigationProcessingSpan) {\n navigationProcessingSpan = undefined;\n }\n };\n\n const clearStateChangeTimeout = (): void => {\n if (typeof stateChangeTimeout !== 'undefined') {\n clearTimeout(stateChangeTimeout);\n stateChangeTimeout = undefined;\n }\n };\n\n return {\n name: INTEGRATION_NAME,\n afterAllSetup,\n registerNavigationContainer,\n options: {\n routeChangeTimeoutMs,\n enableTimeToInitialDisplay,\n ignoreEmptyBackNavigationTransactions,\n enableTimeToInitialDisplayForPreloadedRoutes,\n useDispatchedActionData,\n useFullPathsForNavigationRoutes,\n },\n };\n};\n\nexport interface NavigationRoute {\n name: string;\n key: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n params?: Record<string, any>;\n state?: NavigationState;\n}\n\ninterface NavigationState {\n index?: number;\n routes: NavigationRoute[];\n}\n\ninterface NavigationContainer {\n addListener: (type: string, listener: (event?: unknown) => void) => void;\n getCurrentRoute: () => NavigationRoute;\n getState: () => NavigationState | undefined;\n}\n\n/**\n * Returns React Navigation integration of the given client.\n */\nexport function getReactNavigationIntegration(\n client: Client,\n): ReturnType<typeof reactNavigationIntegration> | undefined {\n return client.getIntegrationByName<ReturnType<typeof reactNavigationIntegration>>(INTEGRATION_NAME);\n}\n"]}
1
+ {"version":3,"file":"reactnavigation.js","sourceRoot":"","sources":["../../../src/js/tracing/reactnavigation.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,KAAK,EACL,SAAS,EACT,aAAa,EACb,4BAA4B,EAC5B,gCAAgC,EAChC,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,MAAM,E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CAAC,CAAC;AACtG,CAAC","sourcesContent":["/* eslint-disable max-lines */\nimport type { Client, Integration, Span } from '@sentry/core';\nimport {\n addBreadcrumb,\n debug,\n getClient,\n isPlainObject,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_OK,\n spanToJSON,\n startInactiveSpan,\n timestampInSeconds,\n} from '@sentry/core';\nimport { getAppRegistryIntegration } from '../integrations/appRegistry';\nimport { isSentrySpan } from '../utils/span';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport type { UnsafeAction } from '../vendor/react-navigation/types';\nimport { NATIVE } from '../wrapper';\nimport { ignoreEmptyBackNavigation, ignoreEmptyRouteChangeTransactions } from './onSpanEndUtils';\nimport { SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION } from './origin';\nimport type { ReactNativeTracingIntegration } from './reactnativetracing';\nimport { getReactNativeTracingIntegration } from './reactnativetracing';\nimport { SEMANTIC_ATTRIBUTE_NAVIGATION_ACTION_TYPE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from './semanticAttributes';\nimport {\n DEFAULT_NAVIGATION_SPAN_NAME,\n defaultIdleOptions,\n getDefaultIdleNavigationSpanOptions,\n startIdleNavigationSpan as startGenericIdleNavigationSpan,\n} from './span';\nimport { addTimeToInitialDisplayFallback } from './timeToDisplayFallback';\n\nexport const INTEGRATION_NAME = 'ReactNavigation';\n\nconst NAVIGATION_HISTORY_MAX_SIZE = 200;\n\n/**\n * Builds a full path from the navigation state by traversing nested navigators.\n * For example, with nested navigators: \"Home/Settings/Profile\"\n */\nfunction getPathFromState(state?: NavigationState): string | undefined {\n if (!state) {\n return undefined;\n }\n\n const routeNames: string[] = [];\n let currentState: NavigationState | undefined = state;\n\n while (currentState) {\n const index: number = currentState.index ?? 0;\n const route: NavigationRoute | undefined = currentState.routes[index];\n if (route?.name) {\n routeNames.push(route.name);\n }\n currentState = route?.state;\n }\n\n return routeNames.length > 0 ? routeNames.join('/') : undefined;\n}\n\ninterface ReactNavigationIntegrationOptions {\n /**\n * How long the instrumentation will wait for the route to mount after a change has been initiated,\n * before the transaction is discarded.\n *\n * @default 1_000 (ms)\n */\n routeChangeTimeoutMs: number;\n\n /**\n * Time to initial display measures the time it takes from\n * navigation dispatch to the render of the first frame of the new screen.\n *\n * @default false\n */\n enableTimeToInitialDisplay: boolean;\n\n /**\n * Does not sample transactions that are from routes that have been seen any more and don't have any spans.\n * This removes a lot of the clutter as most back navigation transactions are now ignored.\n *\n * @default true\n */\n ignoreEmptyBackNavigationTransactions: boolean;\n\n /**\n * Enabled measuring Time to Initial Display for routes that are already loaded in memory.\n * (a.k.a., Routes that the navigation integration has already seen.)\n *\n * @default false\n */\n enableTimeToInitialDisplayForPreloadedRoutes: boolean;\n\n /**\n * Whether to use the dispatched action data to populate the transaction metadata.\n *\n * @default false\n */\n useDispatchedActionData: boolean;\n\n /**\n * Whether to use the full paths for navigation routes.\n *\n * @default false\n */\n useFullPathsForNavigationRoutes: boolean;\n\n /**\n * Track performance of route prefetching operations.\n * Creates separate spans for PRELOAD actions to measure prefetch performance.\n * This is useful for Expo Router apps that use the prefetch functionality.\n *\n * @default false\n */\n enablePrefetchTracking: boolean;\n}\n\n/**\n * Instrumentation for React-Navigation V5 and above. See docs or sample app for usage.\n *\n * How this works:\n * - `_onDispatch` is called every time a dispatch happens and sets an IdleTransaction on the scope without any route context.\n * - `_onStateChange` is then called AFTER the state change happens due to a dispatch and sets the route context onto the active transaction.\n * - If `_onStateChange` isn't called within `STATE_CHANGE_TIMEOUT_DURATION` of the dispatch, then the transaction is not sampled and finished.\n */\nexport const reactNavigationIntegration = ({\n routeChangeTimeoutMs = 1_000,\n enableTimeToInitialDisplay = false,\n ignoreEmptyBackNavigationTransactions = true,\n enableTimeToInitialDisplayForPreloadedRoutes = false,\n useDispatchedActionData = false,\n useFullPathsForNavigationRoutes = false,\n enablePrefetchTracking = false,\n}: Partial<ReactNavigationIntegrationOptions> = {}): Integration & {\n /**\n * Pass the ref to the navigation container to register it to the instrumentation\n * @param navigationContainerRef Ref to a `NavigationContainer`\n */\n registerNavigationContainer: (navigationContainerRef: unknown) => void;\n options: ReactNavigationIntegrationOptions;\n} => {\n let navigationContainer: NavigationContainer | undefined;\n\n let tracing: ReactNativeTracingIntegration | undefined;\n let idleSpanOptions: Parameters<typeof startGenericIdleNavigationSpan>[1] = defaultIdleOptions;\n let latestRoute: NavigationRoute | undefined;\n\n let latestNavigationSpan: Span | undefined;\n let navigationProcessingSpan: Span | undefined;\n\n let initialStateHandled: boolean = false;\n let stateChangeTimeout: ReturnType<typeof setTimeout> | undefined;\n let recentRouteKeys: string[] = [];\n\n if (enableTimeToInitialDisplay) {\n NATIVE.initNativeReactNavigationNewFrameTracking().catch((reason: unknown) => {\n debug.error(`${INTEGRATION_NAME} Failed to initialize native new frame tracking: ${reason}`);\n });\n }\n\n /**\n * Set the initial state and start initial navigation span for the current screen.\n */\n const afterAllSetup = (client: Client): void => {\n tracing = getReactNativeTracingIntegration(client);\n if (tracing) {\n idleSpanOptions = {\n finalTimeout: tracing.options.finalTimeoutMs,\n idleTimeout: tracing.options.idleTimeoutMs,\n };\n }\n\n if (initialStateHandled) {\n // We create an initial state here to ensure a transaction gets created before the first route mounts.\n // This assumes that the Sentry.init() call is made before the first route mounts.\n // If this is not the case, the first transaction will be nameless 'Route Changed'\n return undefined;\n }\n\n getAppRegistryIntegration(client)?.onRunApplication(() => {\n if (initialStateHandled) {\n // To avoid conflict with the initial transaction we check if it was already handled.\n // This ensures runApplication calls after the initial start are correctly traced.\n // This is used for example when Activity is (re)started on Android.\n debug.log('[ReactNavigationIntegration] Starting new idle navigation span based on runApplication call.');\n startIdleNavigationSpan(undefined, true);\n }\n });\n\n startIdleNavigationSpan();\n\n if (!navigationContainer) {\n // This is expected as navigation container is registered after the root component is mounted.\n return undefined;\n }\n\n // Navigation container already registered, just populate with route state\n updateLatestNavigationSpanWithCurrentRoute();\n initialStateHandled = true;\n };\n\n const registerNavigationContainer = (maybeNewNavigationContainer: unknown): void => {\n if (RN_GLOBAL_OBJ.__sentry_rn_v5_registered) {\n debug.log(`${INTEGRATION_NAME} Instrumentation already exists, but registering again...`);\n // In the past we have not allowed re-registering the navigation container to avoid unexpected behavior.\n // But this doesn't work for Android and re-recreating application main activity.\n // Where new navigation container is created and the old one is discarded. We need to re-register to\n // trace the new navigation container navigation.\n }\n\n let newNavigationContainer: NavigationContainer | undefined;\n if (isPlainObject(maybeNewNavigationContainer) && 'current' in maybeNewNavigationContainer) {\n newNavigationContainer = maybeNewNavigationContainer.current as NavigationContainer;\n } else {\n newNavigationContainer = maybeNewNavigationContainer as NavigationContainer;\n }\n\n if (navigationContainer === newNavigationContainer) {\n debug.log(`${INTEGRATION_NAME} Navigation container ref is the same as the one already registered.`);\n return;\n }\n navigationContainer = newNavigationContainer;\n\n if (!navigationContainer) {\n debug.warn(`${INTEGRATION_NAME} Received invalid navigation container ref!`);\n return undefined;\n }\n\n // This action is emitted on every dispatch\n navigationContainer.addListener('__unsafe_action__', startIdleNavigationSpan);\n navigationContainer.addListener('state', updateLatestNavigationSpanWithCurrentRoute);\n RN_GLOBAL_OBJ.__sentry_rn_v5_registered = true;\n\n if (initialStateHandled) {\n return undefined;\n }\n\n if (!latestNavigationSpan) {\n debug.log(`${INTEGRATION_NAME} Navigation container registered, but integration has not been setup yet.`);\n return undefined;\n }\n\n // Navigation Container is registered after the first navigation\n // Initial navigation span was started, after integration setup,\n // so now we populate it with the current route.\n updateLatestNavigationSpanWithCurrentRoute();\n initialStateHandled = true;\n };\n\n /**\n * To be called on every React-Navigation action dispatch.\n * It does not name the transaction or populate it with route information. Instead, it waits for the state to fully change\n * and gets the route information from there, @see updateLatestNavigationSpanWithCurrentRoute\n *\n * @param unknownEvent - The event object that contains navigation action data\n * @param isAppRestart - Whether this span is being started due to an app restart rather than a normal navigation action\n */\n const startIdleNavigationSpan = (unknownEvent?: unknown, isAppRestart = false): void => {\n const event = unknownEvent as UnsafeAction | undefined;\n if (useDispatchedActionData && event?.data.noop) {\n debug.log(`${INTEGRATION_NAME} Navigation action is a noop, not starting navigation span.`);\n return;\n }\n\n const navigationActionType = useDispatchedActionData ? event?.data.action.type : undefined;\n\n // Handle PRELOAD actions separately if prefetch tracking is enabled\n if (enablePrefetchTracking && navigationActionType === 'PRELOAD') {\n const preloadData = event?.data.action;\n const payload = preloadData?.payload;\n const targetRoute =\n payload && typeof payload === 'object' && 'name' in payload && typeof payload.name === 'string'\n ? payload.name\n : 'Unknown Route';\n\n debug.log(`${INTEGRATION_NAME} Starting prefetch span for route: ${targetRoute}`);\n\n const prefetchSpan = startInactiveSpan({\n op: 'navigation.prefetch',\n name: `Prefetch ${targetRoute}`,\n attributes: {\n 'route.name': targetRoute,\n },\n });\n\n // Store prefetch span to end it when state changes or timeout\n navigationProcessingSpan = prefetchSpan;\n\n // Set timeout to ensure we don't leave hanging spans\n stateChangeTimeout = setTimeout(() => {\n if (navigationProcessingSpan === prefetchSpan) {\n debug.log(`${INTEGRATION_NAME} Prefetch span timed out for route: ${targetRoute}`);\n prefetchSpan?.setStatus({ code: SPAN_STATUS_OK });\n prefetchSpan?.end();\n navigationProcessingSpan = undefined;\n }\n }, routeChangeTimeoutMs);\n\n return;\n }\n\n if (\n useDispatchedActionData &&\n navigationActionType &&\n [\n // Process common actions\n 'PRELOAD', // Still filter PRELOAD when enablePrefetchTracking is false\n 'SET_PARAMS',\n // Drawer actions\n 'OPEN_DRAWER',\n 'CLOSE_DRAWER',\n 'TOGGLE_DRAWER',\n ].includes(navigationActionType)\n ) {\n debug.log(`${INTEGRATION_NAME} Navigation action is ${navigationActionType}, not starting navigation span.`);\n return;\n }\n\n if (latestNavigationSpan) {\n debug.log(`${INTEGRATION_NAME} A transaction was detected that turned out to be a noop, discarding.`);\n _discardLatestTransaction();\n clearStateChangeTimeout();\n }\n\n latestNavigationSpan = startGenericIdleNavigationSpan(\n tracing?.options.beforeStartSpan\n ? tracing.options.beforeStartSpan(getDefaultIdleNavigationSpanOptions())\n : getDefaultIdleNavigationSpanOptions(),\n { ...idleSpanOptions, isAppRestart },\n );\n latestNavigationSpan?.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION);\n latestNavigationSpan?.setAttribute(SEMANTIC_ATTRIBUTE_NAVIGATION_ACTION_TYPE, navigationActionType);\n if (ignoreEmptyBackNavigationTransactions) {\n ignoreEmptyBackNavigation(getClient(), latestNavigationSpan);\n }\n // Always discard transactions that never receive route information\n const spanToCheck = latestNavigationSpan;\n ignoreEmptyRouteChangeTransactions(\n getClient(),\n spanToCheck,\n DEFAULT_NAVIGATION_SPAN_NAME,\n () => latestNavigationSpan === spanToCheck,\n );\n\n if (enableTimeToInitialDisplay && latestNavigationSpan) {\n NATIVE.setActiveSpanId(latestNavigationSpan.spanContext().spanId);\n navigationProcessingSpan = startInactiveSpan({\n op: 'navigation.processing',\n name: 'Navigation dispatch to navigation cancelled or screen mounted',\n startTime: spanToJSON(latestNavigationSpan).start_timestamp,\n });\n navigationProcessingSpan.setAttribute(\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION,\n );\n }\n\n stateChangeTimeout = setTimeout(_discardLatestTransaction, routeChangeTimeoutMs);\n };\n\n /**\n * To be called AFTER the state has been changed to populate the transaction with the current route.\n */\n const updateLatestNavigationSpanWithCurrentRoute = (): void => {\n const stateChangedTimestamp = timestampInSeconds();\n const previousRoute = latestRoute;\n\n if (!navigationContainer) {\n debug.warn(`${INTEGRATION_NAME} Missing navigation container ref. Route transactions will not be sent.`);\n return undefined;\n }\n\n const route = navigationContainer.getCurrentRoute();\n if (!route) {\n debug.log(`[${INTEGRATION_NAME}] Navigation state changed, but no route is rendered.`);\n return undefined;\n }\n\n if (!latestNavigationSpan) {\n debug.log(\n `[${INTEGRATION_NAME}] Navigation state changed, but navigation transaction was not started on dispatch.`,\n );\n return undefined;\n }\n\n addTimeToInitialDisplayFallback(latestNavigationSpan.spanContext().spanId, NATIVE.getNewScreenTimeToDisplay());\n\n if (previousRoute && previousRoute.key === route.key) {\n debug.log(`[${INTEGRATION_NAME}] Navigation state changed, but route is the same as previous.`);\n pushRecentRouteKey(route.key);\n latestRoute = route;\n\n // Clear the latest transaction as it has been handled.\n latestNavigationSpan = undefined;\n return undefined;\n }\n\n const routeHasBeenSeen = recentRouteKeys.includes(route.key);\n\n // Get the full navigation path for nested navigators\n let routeName = route.name;\n if (useFullPathsForNavigationRoutes) {\n const navigationState = navigationContainer.getState();\n routeName = getPathFromState(navigationState) || route.name;\n }\n\n navigationProcessingSpan?.updateName(`Navigation dispatch to screen ${routeName} mounted`);\n navigationProcessingSpan?.setStatus({ code: SPAN_STATUS_OK });\n navigationProcessingSpan?.end(stateChangedTimestamp);\n navigationProcessingSpan = undefined;\n\n if (spanToJSON(latestNavigationSpan).description === DEFAULT_NAVIGATION_SPAN_NAME) {\n latestNavigationSpan.updateName(routeName);\n }\n latestNavigationSpan.setAttributes({\n 'route.name': routeName,\n 'route.key': route.key,\n // TODO: filter PII params instead of dropping them all\n // 'route.params': {},\n 'route.has_been_seen': routeHasBeenSeen,\n 'previous_route.name': previousRoute?.name,\n 'previous_route.key': previousRoute?.key,\n // TODO: filter PII params instead of dropping them all\n // 'previous_route.params': {},\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n });\n\n // Clear the timeout so the transaction does not get cancelled.\n clearStateChangeTimeout();\n\n addBreadcrumb({\n category: 'navigation',\n type: 'navigation',\n message: `Navigation to ${routeName}`,\n data: {\n from: previousRoute?.name,\n to: routeName,\n },\n });\n\n tracing?.setCurrentRoute(routeName);\n\n pushRecentRouteKey(route.key);\n if (useFullPathsForNavigationRoutes) {\n latestRoute = { ...route, name: routeName };\n } else {\n latestRoute = route;\n }\n // Clear the latest transaction as it has been handled.\n latestNavigationSpan = undefined;\n };\n\n /** Pushes a recent route key, and removes earlier routes when there is greater than the max length */\n const pushRecentRouteKey = (key: string): void => {\n recentRouteKeys.push(key);\n\n if (recentRouteKeys.length > NAVIGATION_HISTORY_MAX_SIZE) {\n recentRouteKeys = recentRouteKeys.slice(recentRouteKeys.length - NAVIGATION_HISTORY_MAX_SIZE);\n }\n };\n\n /** Cancels the latest transaction so it does not get sent to Sentry. */\n const _discardLatestTransaction = (): void => {\n if (latestNavigationSpan) {\n if (isSentrySpan(latestNavigationSpan)) {\n latestNavigationSpan['_sampled'] = false;\n }\n // TODO: What if it's not SentrySpan?\n latestNavigationSpan.end();\n latestNavigationSpan = undefined;\n }\n if (navigationProcessingSpan) {\n navigationProcessingSpan = undefined;\n }\n };\n\n const clearStateChangeTimeout = (): void => {\n if (typeof stateChangeTimeout !== 'undefined') {\n clearTimeout(stateChangeTimeout);\n stateChangeTimeout = undefined;\n }\n };\n\n return {\n name: INTEGRATION_NAME,\n afterAllSetup,\n registerNavigationContainer,\n options: {\n routeChangeTimeoutMs,\n enableTimeToInitialDisplay,\n ignoreEmptyBackNavigationTransactions,\n enableTimeToInitialDisplayForPreloadedRoutes,\n useDispatchedActionData,\n useFullPathsForNavigationRoutes,\n enablePrefetchTracking,\n },\n };\n};\n\nexport interface NavigationRoute {\n name: string;\n key: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n params?: Record<string, any>;\n state?: NavigationState;\n}\n\ninterface NavigationState {\n index?: number;\n routes: NavigationRoute[];\n}\n\ninterface NavigationContainer {\n addListener: (type: string, listener: (event?: unknown) => void) => void;\n getCurrentRoute: () => NavigationRoute;\n getState: () => NavigationState | undefined;\n}\n\n/**\n * Returns React Navigation integration of the given client.\n */\nexport function getReactNavigationIntegration(\n client: Client,\n): ReturnType<typeof reactNavigationIntegration> | undefined {\n return client.getIntegrationByName<ReturnType<typeof reactNavigationIntegration>>(INTEGRATION_NAME);\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  export declare const SDK_PACKAGE_NAME = "npm:@sentry/react-native";
2
2
  export declare const SDK_NAME = "sentry.javascript.react-native";
3
- export declare const SDK_VERSION = "7.10.0";
3
+ export declare const SDK_VERSION = "7.12.0";
4
4
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';
2
2
  export const SDK_NAME = 'sentry.javascript.react-native';
3
- export const SDK_VERSION = '7.10.0';
3
+ export const SDK_VERSION = '7.12.0';
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '7.10.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '7.12.0';\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { Breadcrumb, Envelope, EnvelopeItem, Event, Package, Primitive, SeverityLevel, User } from '@sentry/core';
2
2
  import { Platform } from 'react-native';
3
3
  import type { NativeAppStartResponse, NativeDeviceContextsResponse, NativeFramesResponse, NativeReleaseResponse, NativeStackFrames, Spec } from './NativeRNSentry';
4
- import type { AndroidProfilingOptions, ReactNativeClientOptions } from './options';
4
+ import type { ProfilingOptions, ReactNativeClientOptions } from './options';
5
5
  import type * as Hermes from './profiling/hermes';
6
6
  import type { NativeAndroidProfileEvent, NativeProfileEvent } from './profiling/nativeTypes';
7
7
  import type { MobileReplayOptions } from './replay/mobilereplay';
@@ -21,7 +21,9 @@ export type NativeSdkOptions = Partial<ReactNativeClientOptions> & {
21
21
  ignoreErrorsRegex?: string[] | undefined;
22
22
  } & {
23
23
  mobileReplayOptions: MobileReplayOptions | undefined;
24
- androidProfilingOptions?: AndroidProfilingOptions | undefined;
24
+ profilingOptions?: ProfilingOptions | undefined;
25
+ /** @deprecated Use `profilingOptions` instead. */
26
+ androidProfilingOptions?: ProfilingOptions | undefined;
25
27
  };
26
28
  interface SentryNativeWrapper {
27
29
  enableNative: boolean;
@@ -60,6 +62,8 @@ interface SentryNativeWrapper {
60
62
  setExtra(key: string, extra: unknown): void;
61
63
  setUser(user: User | null): void;
62
64
  setTag(key: string, value?: string): void;
65
+ setAttribute(key: string, value: string | number | boolean): void;
66
+ setAttributes(attributes: Record<string, string | number | boolean>): void;
63
67
  nativeCrash(): void;
64
68
  fetchModules(): Promise<Record<string, string> | null>;
65
69
  fetchViewHierarchy(): PromiseLike<Uint8Array | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/js/wrapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,OAAO,EACP,SAAS,EACT,aAAa,EACb,IAAI,EACL,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAiB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EACV,sBAAsB,EACtB,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EAErB,iBAAiB,EACjB,IAAI,EACL,MAAM,kBAAkB,CAAC;A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AEtC,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEzD,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC;CAC9C;AAID;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,mBAyyBpB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAE5E"}
@@ -155,11 +155,13 @@ export const NATIVE = {
155
155
  }
156
156
  // filter out all the options that would crash native.
157
157
  /* eslint-disable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */
158
- const { beforeSend, beforeBreadcrumb, beforeSendTransaction, beforeSendMetric, integrations, ignoreErrors, logsOrigin, androidProfilingOptions } = options, filteredOptions = __rest(options, ["beforeSend", "beforeBreadcrumb", "beforeSendTransaction", "beforeSendMetric", "integrations", "ignoreErrors", "logsOrigin", "androidProfilingOptions"]);
158
+ const { beforeSend, beforeBreadcrumb, beforeSendTransaction, beforeSendMetric, integrations, ignoreErrors, logsOrigin, profilingOptions, androidProfilingOptions } = options, filteredOptions = __rest(options, ["beforeSend", "beforeBreadcrumb", "beforeSendTransaction", "beforeSendMetric", "integrations", "ignoreErrors", "logsOrigin", "profilingOptions", "androidProfilingOptions"]);
159
159
  /* eslint-enable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */
160
- // Move androidProfilingOptions into _experiments
161
- if (androidProfilingOptions) {
162
- filteredOptions._experiments = Object.assign(Object.assign({}, filteredOptions._experiments), { androidProfilingOptions });
160
+ // Move profilingOptions into _experiments
161
+ // Support deprecated androidProfilingOptions for backwards compatibility
162
+ const resolvedProfilingOptions = profilingOptions !== null && profilingOptions !== void 0 ? profilingOptions : androidProfilingOptions;
163
+ if (resolvedProfilingOptions) {
164
+ filteredOptions._experiments = Object.assign(Object.assign({}, filteredOptions._experiments), { profilingOptions: resolvedProfilingOptions });
163
165
  }
164
166
  const nativeIsReady = yield RNSentry.initNativeSdk(filteredOptions);
165
167
  this.nativeIsReady = nativeIsReady;
@@ -392,6 +394,38 @@ export const NATIVE = {
392
394
  RNSentry.setContext(key, { error: '**non-serializable**' });
393
395
  }
394
396
  },
397
+ /**
398
+ * Sets an attribute on the native scope.
399
+ * @param key string
400
+ * @param value primitive value (string, number, or boolean)
401
+ */
402
+ setAttribute(key, value) {
403
+ if (!this.enableNative) {
404
+ return;
405
+ }
406
+ if (!this._isModuleLoaded(RNSentry)) {
407
+ throw this._NativeClientError;
408
+ }
409
+ const stringifiedValue = this.primitiveProcessor(value);
410
+ RNSentry.setAttribute(key, stringifiedValue);
411
+ },
412
+ /**
413
+ * Sets multiple attributes on the native scope.
414
+ * @param attributes key-value map of attributes (only string, number, and boolean values)
415
+ */
416
+ setAttributes(attributes) {
417
+ if (!this.enableNative) {
418
+ return;
419
+ }
420
+ if (!this._isModuleLoaded(RNSentry)) {
421
+ throw this._NativeClientError;
422
+ }
423
+ const serializedAttributes = {};
424
+ Object.keys(attributes).forEach(key => {
425
+ serializedAttributes[key] = this.primitiveProcessor(attributes[key]);
426
+ });
427
+ RNSentry.setAttributes(serializedAttributes);
428
+ },
395
429
  /**
396
430
  * Closes the Native Layer SDK
397
431
  */
@@ -1 +1 @@
1
- {"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/js/wrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAYA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAerC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MA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U,CAAC,EAAE,CAAC,iCAC7C,UAAU,KACb,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,IAC1E,CAAC,GACJ,CAAC;QAEF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,aAAa,CAAC,KAAoB;QAChC,IAAI,KAAK,IAAK,KAAuB,EAAE;YACrC,OAAO,OAAwB,CAAC;SACjC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,MAAwB;QACtC,OAAO,CAAC,CAAC,MAAM,CAAC;IAClB,CAAC;IAED,sBAAsB,EAAE,UAAU,SAAoC;QACpE,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACtC,CAAC;IAED,oBAAoB,EAAE,IAAI,WAAW,CAAC,oBAAoB,CAAC;IAE3D,kBAAkB,EAAE,IAAI,WAAW,CAAC,wDAAwD,CAAC;IAE7F,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,QAAQ,CAAC,EAAE;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAgB,cAAc,CAAC,GAAW;;QAC9C,OAAO,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;CAAA","sourcesContent":["/* eslint-disable max-lines */\nimport type {\n BaseEnvelopeItemHeaders,\n Breadcrumb,\n Envelope,\n EnvelopeItem,\n Event,\n Package,\n Primitive,\n SeverityLevel,\n User,\n} from '@sentry/core';\nimport { debug, normalize, SentryError } from '@sentry/core';\nimport { NativeModules, Platform } from 'react-native';\nimport { isHardCrash } from './misc';\nimport type {\n NativeAppStartResponse,\n NativeDeviceContextsResponse,\n NativeFramesResponse,\n NativeReleaseResponse,\n NativeScreenshot,\n NativeStackFrames,\n Spec,\n} from './NativeRNSentry';\nimport type { AndroidProfilingOptions, ReactNativeClientOptions } from './options';\nimport type * as Hermes from './profiling/hermes';\nimport type { NativeAndroidProfileEvent, NativeProfileEvent } from './profiling/nativeTypes';\nimport type { MobileReplayOptions } from './replay/mobilereplay';\nimport type { RequiredKeysUser } from './user';\nimport { encodeUTF8 } from './utils/encode';\nimport { isTurboModuleEnabled } from './utils/environment';\nimport { convertToNormalizedObject } from './utils/normalize';\nimport { ReactNativeLibraries } from './utils/rnlibraries';\nimport { base64StringFromByteArray } from './vendor';\n\n/**\n * Returns the RNSentry module. Dynamically resolves if NativeModule or TurboModule is used.\n */\nexport function getRNSentryModule(): Spec | undefined {\n return isTurboModuleEnabled()\n ? ReactNativeLibraries.TurboModuleRegistry?.get<Spec>('RNSentry')\n : NativeModules.RNSentry;\n}\n\nconst RNSentry: Spec | undefined = getRNSentryModule();\n\nexport interface Screenshot {\n data: Uint8Array;\n contentType: string;\n filename: string;\n}\n\nexport type NativeSdkOptions = Partial<ReactNativeClientOptions> & {\n devServerUrl: string | undefined;\n defaultSidecarUrl: string | undefined;\n ignoreErrorsStr?: string[] | undefined;\n ignoreErrorsRegex?: string[] | undefined;\n} & {\n mobileReplayOptions: MobileReplayOptions | undefined;\n androidProfilingOptions?: AndroidProfilingOptions | undefined;\n};\n\ninterface SentryNativeWrapper {\n enableNative: boolean;\n nativeIsReady: boolean;\n platform: typeof Platform.OS;\n\n _NativeClientError: Error;\n _DisabledNativeError: Error;\n\n _setPrimitiveProcessor: (processor: (value: Primitive) => void) => void;\n _processItem(envelopeItem: EnvelopeItem): EnvelopeItem;\n _processLevels(event: Event): Event;\n _processLevel(level: SeverityLevel): SeverityLevel;\n _serializeObject(data: { [key: string]: unknown }): { [key: string]: string };\n _isModuleLoaded(module: Spec | undefined): module is Spec;\n\n isNativeAvailable(): boolean;\n\n initNativeSdk(options: NativeSdkOptions): PromiseLike<boolean>;\n closeNativeSdk(): PromiseLike<void>;\n\n sendEnvelope(envelope: Envelope): Promise<void>;\n captureScreenshot(): Promise<Screenshot[] | null>;\n\n fetchNativeRelease(): PromiseLike<NativeReleaseResponse>;\n fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse | null>;\n fetchNativeLogAttributes(): Promise<NativeDeviceContextsResponse | null>;\n fetchNativeAppStart(): PromiseLike<NativeAppStartResponse | null>;\n fetchNativeFrames(): PromiseLike<NativeFramesResponse | null>;\n fetchNativeSdkInfo(): PromiseLike<Package | null>;\n\n disableNativeFramesTracking(): void;\n enableNativeFramesTracking(): void;\n\n addBreadcrumb(breadcrumb: Breadcrumb): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setContext(key: string, context: { [key: string]: any } | null): void;\n clearBreadcrumbs(): void;\n setExtra(key: string, extra: unknown): void;\n setUser(user: User | null): void;\n setTag(key: string, value?: string): void;\n\n nativeCrash(): void;\n\n fetchModules(): Promise<Record<string, string> | null>;\n fetchViewHierarchy(): PromiseLike<Uint8Array | null>;\n\n startProfiling(platformProfilers: boolean): boolean;\n stopProfiling(): {\n hermesProfile: Hermes.Profile;\n nativeProfile?: NativeProfileEvent;\n androidProfile?: NativeAndroidProfileEvent;\n } | null;\n\n fetchNativePackageName(): string | null;\n\n /**\n * Fetches native stack frames and debug images for the instructions addresses.\n */\n fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | null;\n initNativeReactNavigationNewFrameTracking(): Promise<void>;\n\n captureReplay(isHardCrash: boolean): Promise<string | null>;\n getCurrentReplayId(): string | null;\n\n crashedLastRun(): Promise<boolean | null>;\n getNewScreenTimeToDisplay(): Promise<number | null | undefined>;\n\n getDataFromUri(uri: string): Promise<Uint8Array | null>;\n popTimeToDisplayFor(key: string): Promise<number | undefined | null>;\n\n setActiveSpanId(spanId: string): void;\n\n encodeToBase64(data: Uint8Array): Promise<string | null>;\n\n primitiveProcessor(value: Primitive): string;\n}\n\nconst EOL = encodeUTF8('\\n');\n\n/**\n * Our internal interface for calling native functions\n */\nexport const NATIVE: SentryNativeWrapper = {\n async fetchModules(): Promise<Record<string, string> | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const raw = await RNSentry.fetchModules();\n if (raw) {\n return JSON.parse(raw);\n }\n return null;\n },\n /**\n * Sending the envelope over the bridge to native\n * @param envelope Envelope\n */\n async sendEnvelope(envelope: Envelope): Promise<void> {\n if (!this.enableNative) {\n debug.warn('Event was skipped as native SDK is not enabled.');\n return;\n }\n\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const [envelopeHeader, envelopeItems] = envelope;\n\n const headerString = JSON.stringify(envelopeHeader);\n const headerBytes = encodeUTF8(headerString);\n let envelopeBytes: Uint8Array = new Uint8Array(headerBytes.length + EOL.length);\n envelopeBytes.set(headerBytes);\n envelopeBytes.set(EOL, headerBytes.length);\n\n let hardCrashed: boolean = false;\n for (const rawItem of envelopeItems) {\n const [itemHeader, itemPayload] = this._processItem(rawItem);\n\n let bytesContentType: string;\n let bytesPayload: number[] | Uint8Array | undefined;\n\n if (typeof itemPayload === 'string') {\n bytesContentType = 'text/plain';\n bytesPayload = encodeUTF8(itemPayload);\n } else if (itemPayload instanceof Uint8Array) {\n bytesContentType =\n typeof itemHeader.content_type === 'string' ? itemHeader.content_type : 'application/octet-stream';\n bytesPayload = itemPayload;\n } else {\n bytesContentType = typeof itemHeader.content_type === 'string' ? itemHeader.content_type : 'application/json';\n bytesPayload = encodeUTF8(JSON.stringify(itemPayload));\n if (!hardCrashed) {\n hardCrashed = isHardCrash(itemPayload);\n }\n }\n\n // Content type is not inside BaseEnvelopeItemHeaders.\n (itemHeader as BaseEnvelopeItemHeaders).content_type = bytesContentType;\n (itemHeader as BaseEnvelopeItemHeaders).length = bytesPayload.length;\n const serializedItemHeader = JSON.stringify(itemHeader);\n\n const bytesItemHeader = encodeUTF8(serializedItemHeader);\n const newBytes = new Uint8Array(\n envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length + EOL.length,\n );\n newBytes.set(envelopeBytes);\n newBytes.set(bytesItemHeader, envelopeBytes.length);\n newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length);\n newBytes.set(bytesPayload, envelopeBytes.length + bytesItemHeader.length + EOL.length);\n newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length);\n envelopeBytes = newBytes;\n }\n\n await RNSentry.captureEnvelope(base64StringFromByteArray(envelopeBytes), { hardCrashed });\n },\n\n /**\n * Starts native with the provided options.\n * @param options ReactNativeClientOptions\n */\n async initNativeSdk(originalOptions: NativeSdkOptions): Promise<boolean> {\n const options: NativeSdkOptions = {\n enableNative: true,\n autoInitializeNativeSdk: true,\n ...originalOptions,\n // Keeps original behavior of enableLogs by not setting it when not defined.\n ...(originalOptions.enableLogs !== undefined\n ? { enableLogs: originalOptions.enableLogs && originalOptions.logsOrigin !== 'js' }\n : {}),\n };\n\n if (!options.enableNative) {\n if (options.enableNativeNagger) {\n debug.warn('Note: Native Sentry SDK is disabled.');\n }\n this.enableNative = false;\n return false;\n }\n if (!options.autoInitializeNativeSdk) {\n if (options.enableNativeNagger) {\n debug.warn(\n 'Note: Native Sentry SDK was not initialized automatically, you will need to initialize it manually. If you wish to disable the native SDK and get rid of this warning, pass enableNative: false',\n );\n }\n this.enableNative = true;\n return false;\n }\n\n if (!options.dsn) {\n debug.warn(\n 'Warning: No DSN was provided. The Sentry SDK will be disabled. Native SDK will also not be initalized.',\n );\n this.enableNative = false;\n return false;\n }\n\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n const ignoreErrorsStr = options.ignoreErrors?.filter(item => typeof item === 'string') as string[] | undefined;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const ignoreErrorsRegex = options.ignoreErrors\n ?.filter(item => item instanceof RegExp)\n .map(item => (item as RegExp).source) as string[] | undefined;\n\n if (ignoreErrorsStr && ignoreErrorsStr.length > 0) {\n options.ignoreErrorsStr = ignoreErrorsStr;\n }\n if (ignoreErrorsRegex && ignoreErrorsRegex.length > 0) {\n options.ignoreErrorsRegex = ignoreErrorsRegex;\n }\n\n // filter out all the options that would crash native.\n /* eslint-disable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\n const {\n beforeSend,\n beforeBreadcrumb,\n beforeSendTransaction,\n beforeSendMetric,\n integrations,\n ignoreErrors,\n logsOrigin,\n androidProfilingOptions,\n ...filteredOptions\n } = options;\n /* eslint-enable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\n\n // Move androidProfilingOptions into _experiments\n if (androidProfilingOptions) {\n filteredOptions._experiments = {\n ...filteredOptions._experiments,\n androidProfilingOptions,\n };\n }\n\n const nativeIsReady = await RNSentry.initNativeSdk(filteredOptions);\n\n this.nativeIsReady = nativeIsReady;\n this.enableNative = true;\n\n return nativeIsReady;\n },\n\n /**\n * Fetches the attributes to be set into logs from Native\n */\n async fetchNativeLogAttributes(): Promise<NativeDeviceContextsResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeLogAttributes();\n },\n /**\n * Fetches the release from native\n */\n async fetchNativeRelease(): Promise<NativeReleaseResponse> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeRelease();\n },\n\n /**\n * Fetches the Sdk info for the native sdk.\n */\n async fetchNativeSdkInfo(): Promise<Package | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeSdkInfo();\n },\n\n /**\n * Fetches the device contexts. Not used on Android.\n */\n async fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeDeviceContexts();\n },\n\n async fetchNativeAppStart(): Promise<NativeAppStartResponse | null> {\n if (!this.enableNative) {\n debug.warn(this._DisabledNativeError);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.error(this._NativeClientError);\n return null;\n }\n\n return RNSentry.fetchNativeAppStart();\n },\n\n async fetchNativeFrames(): Promise<NativeFramesResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeFrames();\n },\n\n /**\n * Triggers a native crash.\n * Use this only for testing purposes.\n */\n nativeCrash(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.crash();\n },\n\n /**\n * Sets the user in the native scope.\n * Passing null clears the user.\n */\n setUser(user: User | null): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n // separate and serialize all non-default user keys.\n let userKeys = null;\n let userDataKeys = null;\n if (user) {\n const { id, ip_address, email, username, geo, ...otherKeys } = user;\n const requiredUser: RequiredKeysUser = {\n id,\n ip_address,\n email,\n username,\n geo,\n };\n userKeys = this._serializeObject(requiredUser);\n userDataKeys = this._serializeObject(otherKeys);\n }\n\n RNSentry.setUser(userKeys, userDataKeys);\n },\n\n /**\n * Sets a tag in the native module.\n * @param key string\n * @param value string\n */\n setTag(key: string, value?: string): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const stringifiedValue = typeof value === 'string' ? value : JSON.stringify(value);\n\n RNSentry.setTag(key, stringifiedValue);\n },\n\n /**\n * Sets an extra in the native scope, will stringify\n * extra value if it isn't already a string.\n * @param key string\n * @param extra any\n */\n setExtra(key: string, extra: unknown): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n if (typeof extra === 'string') {\n return RNSentry.setExtra(key, extra);\n }\n if (typeof extra === 'undefined') {\n return RNSentry.setExtra(key, 'undefined');\n }\n\n let stringifiedExtra: string | undefined;\n try {\n const normalizedExtra = normalize(extra);\n stringifiedExtra = JSON.stringify(normalizedExtra);\n } catch (e) {\n debug.error('Extra for key ${key} not passed to native SDK, because it contains non-stringifiable values', e);\n }\n\n if (typeof stringifiedExtra === 'string') {\n return RNSentry.setExtra(key, stringifiedExtra);\n }\n return RNSentry.setExtra(key, '**non-stringifiable**');\n },\n\n /**\n * Adds breadcrumb to the native scope.\n * @param breadcrumb Breadcrumb\n */\n addBreadcrumb(breadcrumb: Breadcrumb): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.addBreadcrumb({\n ...breadcrumb,\n // Process and convert deprecated levels\n level: breadcrumb.level ? this._processLevel(breadcrumb.level) : undefined,\n });\n },\n\n /**\n * Clears breadcrumbs on the native scope.\n */\n clearBreadcrumbs(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.clearBreadcrumbs();\n },\n\n /**\n * Sets context on the native scope.\n * @param key string\n * @param context key-value map\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setContext(key: string, context: { [key: string]: any } | null): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n if (context === null) {\n return RNSentry.setContext(key, null);\n }\n\n let normalizedContext: Record<string, unknown> | undefined;\n try {\n normalizedContext = convertToNormalizedObject(context);\n } catch (e) {\n debug.error('Context for key ${key} not passed to native SDK, because it contains non-serializable values', e);\n }\n\n if (normalizedContext) {\n RNSentry.setContext(key, normalizedContext);\n } else {\n RNSentry.setContext(key, { error: '**non-serializable**' });\n }\n },\n\n /**\n * Closes the Native Layer SDK\n */\n async closeNativeSdk(): Promise<void> {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n return RNSentry.closeNativeSdk().then(() => {\n this.enableNative = false;\n });\n },\n\n disableNativeFramesTracking(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n RNSentry.disableNativeFramesTracking();\n },\n\n enableNativeFramesTracking(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n RNSentry.enableNativeFramesTracking();\n },\n\n isNativeAvailable(): boolean {\n return this._isModuleLoaded(RNSentry);\n },\n\n async captureScreenshot(): Promise<Screenshot[] | null> {\n if (!this.enableNative) {\n debug.warn(this._DisabledNativeError);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.error(this._NativeClientError);\n return null;\n }\n\n let raw: NativeScreenshot[] | null | undefined;\n try {\n raw = await RNSentry.captureScreenshot();\n } catch (e) {\n debug.warn('Failed to capture screenshot', e);\n }\n\n if (raw) {\n return raw.map((item: NativeScreenshot) => ({\n ...item,\n data: new Uint8Array(item.data),\n }));\n } else {\n return null;\n }\n },\n\n async fetchViewHierarchy(): Promise<Uint8Array | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const raw = await RNSentry.fetchViewHierarchy();\n return raw ? new Uint8Array(raw) : null;\n },\n\n startProfiling(platformProfilers: boolean): boolean {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const { started, error } = RNSentry.startProfiling(platformProfilers);\n if (started) {\n debug.log('[NATIVE] Start Profiling');\n } else {\n debug.error('[NATIVE] Start Profiling Failed', error);\n }\n\n return !!started;\n },\n\n stopProfiling(): {\n hermesProfile: Hermes.Profile;\n nativeProfile?: NativeProfileEvent;\n androidProfile?: NativeAndroidProfileEvent;\n } | null {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const { profile, nativeProfile, androidProfile, error } = RNSentry.stopProfiling();\n if (!profile || error) {\n debug.error('[NATIVE] Stop Profiling Failed', error);\n return null;\n }\n if (Platform.OS === 'ios' && !nativeProfile) {\n debug.warn('[NATIVE] Stop Profiling Failed: No Native Profile');\n }\n if (Platform.OS === 'android' && !androidProfile) {\n debug.warn('[NATIVE] Stop Profiling Failed: No Android Profile');\n }\n\n try {\n return {\n hermesProfile: JSON.parse(profile) as Hermes.Profile,\n nativeProfile: nativeProfile as NativeProfileEvent | undefined,\n androidProfile: androidProfile as NativeAndroidProfileEvent | undefined,\n };\n } catch (e) {\n debug.error('[NATIVE] Failed to parse Hermes Profile JSON', e);\n return null;\n }\n },\n\n fetchNativePackageName(): string | null {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n return RNSentry.fetchNativePackageName() || null;\n },\n\n fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | null {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n return RNSentry.fetchNativeStackFramesBy(instructionsAddr) || null;\n },\n\n async initNativeReactNavigationNewFrameTracking(): Promise<void> {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n return RNSentry.initNativeReactNavigationNewFrameTracking();\n },\n\n async captureReplay(isHardCrash: boolean): Promise<string | null> {\n if (!this.enableNative) {\n debug.warn(`[NATIVE] \\`${this.captureReplay.name}\\` is not available when native is disabled.`);\n return Promise.resolve(null);\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.warn(`[NATIVE] \\`${this.captureReplay.name}\\` is not available when native is not available.`);\n return Promise.resolve(null);\n }\n\n return (await RNSentry.captureReplay(isHardCrash)) || null;\n },\n\n getCurrentReplayId(): string | null {\n if (!this.enableNative) {\n debug.warn(`[NATIVE] \\`${this.getCurrentReplayId.name}\\` is not available when native is disabled.`);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.warn(`[NATIVE] \\`${this.getCurrentReplayId.name}\\` is not available when native is not available.`);\n return null;\n }\n\n return RNSentry.getCurrentReplayId() || null;\n },\n\n async crashedLastRun(): Promise<boolean | null> {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n const result = await RNSentry.crashedLastRun();\n return typeof result === 'boolean' ? result : null;\n },\n\n getNewScreenTimeToDisplay(): Promise<number | null | undefined> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return Promise.resolve(null);\n }\n\n return RNSentry.getNewScreenTimeToDisplay();\n },\n\n async getDataFromUri(uri: string): Promise<Uint8Array | null> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return null;\n }\n try {\n const data: number[] = await RNSentry.getDataFromUri(uri);\n return new Uint8Array(data);\n } catch (error) {\n debug.error('Error:', error);\n return null;\n }\n },\n\n popTimeToDisplayFor(key: string): Promise<number | undefined | null> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return Promise.resolve(null);\n }\n\n try {\n return RNSentry.popTimeToDisplayFor(key);\n } catch (error) {\n debug.error('Error:', error);\n return Promise.resolve(null);\n }\n },\n\n setActiveSpanId(spanId): void {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return undefined;\n }\n\n try {\n RNSentry.setActiveSpanId(spanId);\n } catch (error) {\n debug.error('Error:', error);\n return undefined;\n }\n },\n\n async encodeToBase64(data: Uint8Array): Promise<string | null> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return Promise.resolve(null);\n }\n\n try {\n const byteArray = Array.from(data);\n const base64 = await RNSentry.encodeToBase64(byteArray);\n return base64 || null;\n } catch (error) {\n debug.error('Error:', error);\n return Promise.resolve(null);\n }\n },\n\n primitiveProcessor: function (value: Primitive): string {\n return value as string;\n },\n\n /**\n * Gets the event from envelopeItem and applies the level filter to the selected event.\n * @param data An envelope item containing the event.\n * @returns The event from envelopeItem or undefined.\n */\n _processItem(item: EnvelopeItem): EnvelopeItem {\n const [itemHeader, itemPayload] = item;\n\n if (itemHeader.type == 'event' || itemHeader.type == 'transaction') {\n const event = this._processLevels(itemPayload as Event);\n\n if (NATIVE.platform === 'android') {\n if ('message' in event) {\n // @ts-expect-error Android still uses the old message object, without this the serialization of events will break.\n event.message = { message: event.message };\n }\n }\n\n return [itemHeader, event];\n }\n\n return item;\n },\n\n /**\n * Serializes all values of root-level keys into strings.\n * @param data key-value map.\n * @returns An object where all root-level values are strings.\n */\n _serializeObject(data: { [key: string]: unknown }): { [key: string]: string } {\n const serialized: { [key: string]: string } = {};\n\n Object.keys(data).forEach(dataKey => {\n const value = data[dataKey];\n serialized[dataKey] = typeof value === 'string' ? value : JSON.stringify(value);\n });\n\n return serialized;\n },\n\n /**\n * Convert js severity level in event.level and event.breadcrumbs to more widely supported levels.\n * @param event\n * @returns Event with more widely supported Severity level strings\n */\n _processLevels(event: Event): Event {\n const processed: Event = {\n ...event,\n level: event.level ? this._processLevel(event.level) : undefined,\n breadcrumbs: event.breadcrumbs?.map(breadcrumb => ({\n ...breadcrumb,\n level: breadcrumb.level ? this._processLevel(breadcrumb.level) : undefined,\n })),\n };\n\n return processed;\n },\n\n /**\n * Convert js severity level which has critical and log to more widely supported levels.\n * @param level\n * @returns More widely supported Severity level strings\n */\n _processLevel(level: SeverityLevel): SeverityLevel {\n if (level == ('log' as SeverityLevel)) {\n return 'debug' as SeverityLevel;\n }\n return level;\n },\n\n /**\n * Checks whether the RNSentry module is loaded.\n */\n _isModuleLoaded(module: Spec | undefined): module is Spec {\n return !!module;\n },\n\n _setPrimitiveProcessor: function (processor: (value: Primitive) => any): void {\n this.primitiveProcessor = processor;\n },\n\n _DisabledNativeError: new SentryError('Native is disabled'),\n\n _NativeClientError: new SentryError(\"Native Client is not available, can't start on native.\"),\n\n enableNative: true,\n nativeIsReady: false,\n platform: Platform.OS,\n};\n\n/**\n * Fethces the data from the given uri in Uint8Array format.\n * @param uri string\n * @returns Uint8Array | null\n */\nexport async function getDataFromUri(uri: string): Promise<Uint8Array | null> {\n return NATIVE.getDataFromUri(uri);\n}\n"]}
1
+ {"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/js/wrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAYA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAerC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD;;GAEG;AACH,MAAM,UAAU,iBAAiB;;IAC/B,OAAO,oBAAoB,EAAE;QAC3B,CAAC,CAAC,MAAA,oBAAoB,CAAC,mBAAmB,0CAAE,GAAG,CAAO,UAAU,CAAC;QACjE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC;AAC7B,CAAC;AAED,MAAM,QAAQ,GAAqB,iBAAiB,EAAE,CAAC;AAmGvD,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;AAE7B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAwB;IACnC,YAAY;;YAChB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;gBACtB,MAAM,IAA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,CAAC,GAAW;;QAC9C,OAAO,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;CAAA","sourcesContent":["/* eslint-disable max-lines */\nimport type {\n BaseEnvelopeItemHeaders,\n Breadcrumb,\n Envelope,\n EnvelopeItem,\n Event,\n Package,\n Primitive,\n SeverityLevel,\n User,\n} from '@sentry/core';\nimport { debug, normalize, SentryError } from '@sentry/core';\nimport { NativeModules, Platform } from 'react-native';\nimport { isHardCrash } from './misc';\nimport type {\n NativeAppStartResponse,\n NativeDeviceContextsResponse,\n NativeFramesResponse,\n NativeReleaseResponse,\n NativeScreenshot,\n NativeStackFrames,\n Spec,\n} from './NativeRNSentry';\nimport type { ProfilingOptions, ReactNativeClientOptions } from './options';\nimport type * as Hermes from './profiling/hermes';\nimport type { NativeAndroidProfileEvent, NativeProfileEvent } from './profiling/nativeTypes';\nimport type { MobileReplayOptions } from './replay/mobilereplay';\nimport type { RequiredKeysUser } from './user';\nimport { encodeUTF8 } from './utils/encode';\nimport { isTurboModuleEnabled } from './utils/environment';\nimport { convertToNormalizedObject } from './utils/normalize';\nimport { ReactNativeLibraries } from './utils/rnlibraries';\nimport { base64StringFromByteArray } from './vendor';\n\n/**\n * Returns the RNSentry module. Dynamically resolves if NativeModule or TurboModule is used.\n */\nexport function getRNSentryModule(): Spec | undefined {\n return isTurboModuleEnabled()\n ? ReactNativeLibraries.TurboModuleRegistry?.get<Spec>('RNSentry')\n : NativeModules.RNSentry;\n}\n\nconst RNSentry: Spec | undefined = getRNSentryModule();\n\nexport interface Screenshot {\n data: Uint8Array;\n contentType: string;\n filename: string;\n}\n\nexport type NativeSdkOptions = Partial<ReactNativeClientOptions> & {\n devServerUrl: string | undefined;\n defaultSidecarUrl: string | undefined;\n ignoreErrorsStr?: string[] | undefined;\n ignoreErrorsRegex?: string[] | undefined;\n} & {\n mobileReplayOptions: MobileReplayOptions | undefined;\n profilingOptions?: ProfilingOptions | undefined;\n /** @deprecated Use `profilingOptions` instead. */\n androidProfilingOptions?: ProfilingOptions | undefined;\n};\n\ninterface SentryNativeWrapper {\n enableNative: boolean;\n nativeIsReady: boolean;\n platform: typeof Platform.OS;\n\n _NativeClientError: Error;\n _DisabledNativeError: Error;\n\n _setPrimitiveProcessor: (processor: (value: Primitive) => void) => void;\n _processItem(envelopeItem: EnvelopeItem): EnvelopeItem;\n _processLevels(event: Event): Event;\n _processLevel(level: SeverityLevel): SeverityLevel;\n _serializeObject(data: { [key: string]: unknown }): { [key: string]: string };\n _isModuleLoaded(module: Spec | undefined): module is Spec;\n\n isNativeAvailable(): boolean;\n\n initNativeSdk(options: NativeSdkOptions): PromiseLike<boolean>;\n closeNativeSdk(): PromiseLike<void>;\n\n sendEnvelope(envelope: Envelope): Promise<void>;\n captureScreenshot(): Promise<Screenshot[] | null>;\n\n fetchNativeRelease(): PromiseLike<NativeReleaseResponse>;\n fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse | null>;\n fetchNativeLogAttributes(): Promise<NativeDeviceContextsResponse | null>;\n fetchNativeAppStart(): PromiseLike<NativeAppStartResponse | null>;\n fetchNativeFrames(): PromiseLike<NativeFramesResponse | null>;\n fetchNativeSdkInfo(): PromiseLike<Package | null>;\n\n disableNativeFramesTracking(): void;\n enableNativeFramesTracking(): void;\n\n addBreadcrumb(breadcrumb: Breadcrumb): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setContext(key: string, context: { [key: string]: any } | null): void;\n clearBreadcrumbs(): void;\n setExtra(key: string, extra: unknown): void;\n setUser(user: User | null): void;\n setTag(key: string, value?: string): void;\n setAttribute(key: string, value: string | number | boolean): void;\n setAttributes(attributes: Record<string, string | number | boolean>): void;\n\n nativeCrash(): void;\n\n fetchModules(): Promise<Record<string, string> | null>;\n fetchViewHierarchy(): PromiseLike<Uint8Array | null>;\n\n startProfiling(platformProfilers: boolean): boolean;\n stopProfiling(): {\n hermesProfile: Hermes.Profile;\n nativeProfile?: NativeProfileEvent;\n androidProfile?: NativeAndroidProfileEvent;\n } | null;\n\n fetchNativePackageName(): string | null;\n\n /**\n * Fetches native stack frames and debug images for the instructions addresses.\n */\n fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | null;\n initNativeReactNavigationNewFrameTracking(): Promise<void>;\n\n captureReplay(isHardCrash: boolean): Promise<string | null>;\n getCurrentReplayId(): string | null;\n\n crashedLastRun(): Promise<boolean | null>;\n getNewScreenTimeToDisplay(): Promise<number | null | undefined>;\n\n getDataFromUri(uri: string): Promise<Uint8Array | null>;\n popTimeToDisplayFor(key: string): Promise<number | undefined | null>;\n\n setActiveSpanId(spanId: string): void;\n\n encodeToBase64(data: Uint8Array): Promise<string | null>;\n\n primitiveProcessor(value: Primitive): string;\n}\n\nconst EOL = encodeUTF8('\\n');\n\n/**\n * Our internal interface for calling native functions\n */\nexport const NATIVE: SentryNativeWrapper = {\n async fetchModules(): Promise<Record<string, string> | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const raw = await RNSentry.fetchModules();\n if (raw) {\n return JSON.parse(raw);\n }\n return null;\n },\n /**\n * Sending the envelope over the bridge to native\n * @param envelope Envelope\n */\n async sendEnvelope(envelope: Envelope): Promise<void> {\n if (!this.enableNative) {\n debug.warn('Event was skipped as native SDK is not enabled.');\n return;\n }\n\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const [envelopeHeader, envelopeItems] = envelope;\n\n const headerString = JSON.stringify(envelopeHeader);\n const headerBytes = encodeUTF8(headerString);\n let envelopeBytes: Uint8Array = new Uint8Array(headerBytes.length + EOL.length);\n envelopeBytes.set(headerBytes);\n envelopeBytes.set(EOL, headerBytes.length);\n\n let hardCrashed: boolean = false;\n for (const rawItem of envelopeItems) {\n const [itemHeader, itemPayload] = this._processItem(rawItem);\n\n let bytesContentType: string;\n let bytesPayload: number[] | Uint8Array | undefined;\n\n if (typeof itemPayload === 'string') {\n bytesContentType = 'text/plain';\n bytesPayload = encodeUTF8(itemPayload);\n } else if (itemPayload instanceof Uint8Array) {\n bytesContentType =\n typeof itemHeader.content_type === 'string' ? itemHeader.content_type : 'application/octet-stream';\n bytesPayload = itemPayload;\n } else {\n bytesContentType = typeof itemHeader.content_type === 'string' ? itemHeader.content_type : 'application/json';\n bytesPayload = encodeUTF8(JSON.stringify(itemPayload));\n if (!hardCrashed) {\n hardCrashed = isHardCrash(itemPayload);\n }\n }\n\n // Content type is not inside BaseEnvelopeItemHeaders.\n (itemHeader as BaseEnvelopeItemHeaders).content_type = bytesContentType;\n (itemHeader as BaseEnvelopeItemHeaders).length = bytesPayload.length;\n const serializedItemHeader = JSON.stringify(itemHeader);\n\n const bytesItemHeader = encodeUTF8(serializedItemHeader);\n const newBytes = new Uint8Array(\n envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length + EOL.length,\n );\n newBytes.set(envelopeBytes);\n newBytes.set(bytesItemHeader, envelopeBytes.length);\n newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length);\n newBytes.set(bytesPayload, envelopeBytes.length + bytesItemHeader.length + EOL.length);\n newBytes.set(EOL, envelopeBytes.length + bytesItemHeader.length + EOL.length + bytesPayload.length);\n envelopeBytes = newBytes;\n }\n\n await RNSentry.captureEnvelope(base64StringFromByteArray(envelopeBytes), { hardCrashed });\n },\n\n /**\n * Starts native with the provided options.\n * @param options ReactNativeClientOptions\n */\n async initNativeSdk(originalOptions: NativeSdkOptions): Promise<boolean> {\n const options: NativeSdkOptions = {\n enableNative: true,\n autoInitializeNativeSdk: true,\n ...originalOptions,\n // Keeps original behavior of enableLogs by not setting it when not defined.\n ...(originalOptions.enableLogs !== undefined\n ? { enableLogs: originalOptions.enableLogs && originalOptions.logsOrigin !== 'js' }\n : {}),\n };\n\n if (!options.enableNative) {\n if (options.enableNativeNagger) {\n debug.warn('Note: Native Sentry SDK is disabled.');\n }\n this.enableNative = false;\n return false;\n }\n if (!options.autoInitializeNativeSdk) {\n if (options.enableNativeNagger) {\n debug.warn(\n 'Note: Native Sentry SDK was not initialized automatically, you will need to initialize it manually. If you wish to disable the native SDK and get rid of this warning, pass enableNative: false',\n );\n }\n this.enableNative = true;\n return false;\n }\n\n if (!options.dsn) {\n debug.warn(\n 'Warning: No DSN was provided. The Sentry SDK will be disabled. Native SDK will also not be initalized.',\n );\n this.enableNative = false;\n return false;\n }\n\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n const ignoreErrorsStr = options.ignoreErrors?.filter(item => typeof item === 'string') as string[] | undefined;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const ignoreErrorsRegex = options.ignoreErrors\n ?.filter(item => item instanceof RegExp)\n .map(item => (item as RegExp).source) as string[] | undefined;\n\n if (ignoreErrorsStr && ignoreErrorsStr.length > 0) {\n options.ignoreErrorsStr = ignoreErrorsStr;\n }\n if (ignoreErrorsRegex && ignoreErrorsRegex.length > 0) {\n options.ignoreErrorsRegex = ignoreErrorsRegex;\n }\n\n // filter out all the options that would crash native.\n /* eslint-disable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\n const {\n beforeSend,\n beforeBreadcrumb,\n beforeSendTransaction,\n beforeSendMetric,\n integrations,\n ignoreErrors,\n logsOrigin,\n profilingOptions,\n androidProfilingOptions,\n ...filteredOptions\n } = options;\n /* eslint-enable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\n\n // Move profilingOptions into _experiments\n // Support deprecated androidProfilingOptions for backwards compatibility\n const resolvedProfilingOptions = profilingOptions ?? androidProfilingOptions;\n if (resolvedProfilingOptions) {\n filteredOptions._experiments = {\n ...filteredOptions._experiments,\n profilingOptions: resolvedProfilingOptions,\n };\n }\n\n const nativeIsReady = await RNSentry.initNativeSdk(filteredOptions);\n\n this.nativeIsReady = nativeIsReady;\n this.enableNative = true;\n\n return nativeIsReady;\n },\n\n /**\n * Fetches the attributes to be set into logs from Native\n */\n async fetchNativeLogAttributes(): Promise<NativeDeviceContextsResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeLogAttributes();\n },\n /**\n * Fetches the release from native\n */\n async fetchNativeRelease(): Promise<NativeReleaseResponse> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeRelease();\n },\n\n /**\n * Fetches the Sdk info for the native sdk.\n */\n async fetchNativeSdkInfo(): Promise<Package | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeSdkInfo();\n },\n\n /**\n * Fetches the device contexts. Not used on Android.\n */\n async fetchNativeDeviceContexts(): Promise<NativeDeviceContextsResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeDeviceContexts();\n },\n\n async fetchNativeAppStart(): Promise<NativeAppStartResponse | null> {\n if (!this.enableNative) {\n debug.warn(this._DisabledNativeError);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.error(this._NativeClientError);\n return null;\n }\n\n return RNSentry.fetchNativeAppStart();\n },\n\n async fetchNativeFrames(): Promise<NativeFramesResponse | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n return RNSentry.fetchNativeFrames();\n },\n\n /**\n * Triggers a native crash.\n * Use this only for testing purposes.\n */\n nativeCrash(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.crash();\n },\n\n /**\n * Sets the user in the native scope.\n * Passing null clears the user.\n */\n setUser(user: User | null): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n // separate and serialize all non-default user keys.\n let userKeys = null;\n let userDataKeys = null;\n if (user) {\n const { id, ip_address, email, username, geo, ...otherKeys } = user;\n const requiredUser: RequiredKeysUser = {\n id,\n ip_address,\n email,\n username,\n geo,\n };\n userKeys = this._serializeObject(requiredUser);\n userDataKeys = this._serializeObject(otherKeys);\n }\n\n RNSentry.setUser(userKeys, userDataKeys);\n },\n\n /**\n * Sets a tag in the native module.\n * @param key string\n * @param value string\n */\n setTag(key: string, value?: string): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const stringifiedValue = typeof value === 'string' ? value : JSON.stringify(value);\n\n RNSentry.setTag(key, stringifiedValue);\n },\n\n /**\n * Sets an extra in the native scope, will stringify\n * extra value if it isn't already a string.\n * @param key string\n * @param extra any\n */\n setExtra(key: string, extra: unknown): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n if (typeof extra === 'string') {\n return RNSentry.setExtra(key, extra);\n }\n if (typeof extra === 'undefined') {\n return RNSentry.setExtra(key, 'undefined');\n }\n\n let stringifiedExtra: string | undefined;\n try {\n const normalizedExtra = normalize(extra);\n stringifiedExtra = JSON.stringify(normalizedExtra);\n } catch (e) {\n debug.error('Extra for key ${key} not passed to native SDK, because it contains non-stringifiable values', e);\n }\n\n if (typeof stringifiedExtra === 'string') {\n return RNSentry.setExtra(key, stringifiedExtra);\n }\n return RNSentry.setExtra(key, '**non-stringifiable**');\n },\n\n /**\n * Adds breadcrumb to the native scope.\n * @param breadcrumb Breadcrumb\n */\n addBreadcrumb(breadcrumb: Breadcrumb): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.addBreadcrumb({\n ...breadcrumb,\n // Process and convert deprecated levels\n level: breadcrumb.level ? this._processLevel(breadcrumb.level) : undefined,\n });\n },\n\n /**\n * Clears breadcrumbs on the native scope.\n */\n clearBreadcrumbs(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n RNSentry.clearBreadcrumbs();\n },\n\n /**\n * Sets context on the native scope.\n * @param key string\n * @param context key-value map\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setContext(key: string, context: { [key: string]: any } | null): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n if (context === null) {\n return RNSentry.setContext(key, null);\n }\n\n let normalizedContext: Record<string, unknown> | undefined;\n try {\n normalizedContext = convertToNormalizedObject(context);\n } catch (e) {\n debug.error('Context for key ${key} not passed to native SDK, because it contains non-serializable values', e);\n }\n\n if (normalizedContext) {\n RNSentry.setContext(key, normalizedContext);\n } else {\n RNSentry.setContext(key, { error: '**non-serializable**' });\n }\n },\n\n /**\n * Sets an attribute on the native scope.\n * @param key string\n * @param value primitive value (string, number, or boolean)\n */\n setAttribute(key: string, value: string | number | boolean): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const stringifiedValue = this.primitiveProcessor(value);\n RNSentry.setAttribute(key, stringifiedValue);\n },\n\n /**\n * Sets multiple attributes on the native scope.\n * @param attributes key-value map of attributes (only string, number, and boolean values)\n */\n setAttributes(attributes: Record<string, string | number | boolean>): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const serializedAttributes: Record<string, string> = {};\n Object.keys(attributes).forEach(key => {\n serializedAttributes[key] = this.primitiveProcessor(attributes[key]);\n });\n\n RNSentry.setAttributes(serializedAttributes);\n },\n\n /**\n * Closes the Native Layer SDK\n */\n async closeNativeSdk(): Promise<void> {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n return RNSentry.closeNativeSdk().then(() => {\n this.enableNative = false;\n });\n },\n\n disableNativeFramesTracking(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n RNSentry.disableNativeFramesTracking();\n },\n\n enableNativeFramesTracking(): void {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n RNSentry.enableNativeFramesTracking();\n },\n\n isNativeAvailable(): boolean {\n return this._isModuleLoaded(RNSentry);\n },\n\n async captureScreenshot(): Promise<Screenshot[] | null> {\n if (!this.enableNative) {\n debug.warn(this._DisabledNativeError);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.error(this._NativeClientError);\n return null;\n }\n\n let raw: NativeScreenshot[] | null | undefined;\n try {\n raw = await RNSentry.captureScreenshot();\n } catch (e) {\n debug.warn('Failed to capture screenshot', e);\n }\n\n if (raw) {\n return raw.map((item: NativeScreenshot) => ({\n ...item,\n data: new Uint8Array(item.data),\n }));\n } else {\n return null;\n }\n },\n\n async fetchViewHierarchy(): Promise<Uint8Array | null> {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const raw = await RNSentry.fetchViewHierarchy();\n return raw ? new Uint8Array(raw) : null;\n },\n\n startProfiling(platformProfilers: boolean): boolean {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const { started, error } = RNSentry.startProfiling(platformProfilers);\n if (started) {\n debug.log('[NATIVE] Start Profiling');\n } else {\n debug.error('[NATIVE] Start Profiling Failed', error);\n }\n\n return !!started;\n },\n\n stopProfiling(): {\n hermesProfile: Hermes.Profile;\n nativeProfile?: NativeProfileEvent;\n androidProfile?: NativeAndroidProfileEvent;\n } | null {\n if (!this.enableNative) {\n throw this._DisabledNativeError;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n throw this._NativeClientError;\n }\n\n const { profile, nativeProfile, androidProfile, error } = RNSentry.stopProfiling();\n if (!profile || error) {\n debug.error('[NATIVE] Stop Profiling Failed', error);\n return null;\n }\n if (Platform.OS === 'ios' && !nativeProfile) {\n debug.warn('[NATIVE] Stop Profiling Failed: No Native Profile');\n }\n if (Platform.OS === 'android' && !androidProfile) {\n debug.warn('[NATIVE] Stop Profiling Failed: No Android Profile');\n }\n\n try {\n return {\n hermesProfile: JSON.parse(profile) as Hermes.Profile,\n nativeProfile: nativeProfile as NativeProfileEvent | undefined,\n androidProfile: androidProfile as NativeAndroidProfileEvent | undefined,\n };\n } catch (e) {\n debug.error('[NATIVE] Failed to parse Hermes Profile JSON', e);\n return null;\n }\n },\n\n fetchNativePackageName(): string | null {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n return RNSentry.fetchNativePackageName() || null;\n },\n\n fetchNativeStackFramesBy(instructionsAddr: number[]): NativeStackFrames | null {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n return RNSentry.fetchNativeStackFramesBy(instructionsAddr) || null;\n },\n\n async initNativeReactNavigationNewFrameTracking(): Promise<void> {\n if (!this.enableNative) {\n return;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return;\n }\n\n return RNSentry.initNativeReactNavigationNewFrameTracking();\n },\n\n async captureReplay(isHardCrash: boolean): Promise<string | null> {\n if (!this.enableNative) {\n debug.warn(`[NATIVE] \\`${this.captureReplay.name}\\` is not available when native is disabled.`);\n return Promise.resolve(null);\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.warn(`[NATIVE] \\`${this.captureReplay.name}\\` is not available when native is not available.`);\n return Promise.resolve(null);\n }\n\n return (await RNSentry.captureReplay(isHardCrash)) || null;\n },\n\n getCurrentReplayId(): string | null {\n if (!this.enableNative) {\n debug.warn(`[NATIVE] \\`${this.getCurrentReplayId.name}\\` is not available when native is disabled.`);\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n debug.warn(`[NATIVE] \\`${this.getCurrentReplayId.name}\\` is not available when native is not available.`);\n return null;\n }\n\n return RNSentry.getCurrentReplayId() || null;\n },\n\n async crashedLastRun(): Promise<boolean | null> {\n if (!this.enableNative) {\n return null;\n }\n if (!this._isModuleLoaded(RNSentry)) {\n return null;\n }\n\n const result = await RNSentry.crashedLastRun();\n return typeof result === 'boolean' ? result : null;\n },\n\n getNewScreenTimeToDisplay(): Promise<number | null | undefined> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return Promise.resolve(null);\n }\n\n return RNSentry.getNewScreenTimeToDisplay();\n },\n\n async getDataFromUri(uri: string): Promise<Uint8Array | null> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return null;\n }\n try {\n const data: number[] = await RNSentry.getDataFromUri(uri);\n return new Uint8Array(data);\n } catch (error) {\n debug.error('Error:', error);\n return null;\n }\n },\n\n popTimeToDisplayFor(key: string): Promise<number | undefined | null> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return Promise.resolve(null);\n }\n\n try {\n return RNSentry.popTimeToDisplayFor(key);\n } catch (error) {\n debug.error('Error:', error);\n return Promise.resolve(null);\n }\n },\n\n setActiveSpanId(spanId): void {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return undefined;\n }\n\n try {\n RNSentry.setActiveSpanId(spanId);\n } catch (error) {\n debug.error('Error:', error);\n return undefined;\n }\n },\n\n async encodeToBase64(data: Uint8Array): Promise<string | null> {\n if (!this.enableNative || !this._isModuleLoaded(RNSentry)) {\n return Promise.resolve(null);\n }\n\n try {\n const byteArray = Array.from(data);\n const base64 = await RNSentry.encodeToBase64(byteArray);\n return base64 || null;\n } catch (error) {\n debug.error('Error:', error);\n return Promise.resolve(null);\n }\n },\n\n primitiveProcessor: function (value: Primitive): string {\n return value as string;\n },\n\n /**\n * Gets the event from envelopeItem and applies the level filter to the selected event.\n * @param data An envelope item containing the event.\n * @returns The event from envelopeItem or undefined.\n */\n _processItem(item: EnvelopeItem): EnvelopeItem {\n const [itemHeader, itemPayload] = item;\n\n if (itemHeader.type == 'event' || itemHeader.type == 'transaction') {\n const event = this._processLevels(itemPayload as Event);\n\n if (NATIVE.platform === 'android') {\n if ('message' in event) {\n // @ts-expect-error Android still uses the old message object, without this the serialization of events will break.\n event.message = { message: event.message };\n }\n }\n\n return [itemHeader, event];\n }\n\n return item;\n },\n\n /**\n * Serializes all values of root-level keys into strings.\n * @param data key-value map.\n * @returns An object where all root-level values are strings.\n */\n _serializeObject(data: { [key: string]: unknown }): { [key: string]: string } {\n const serialized: { [key: string]: string } = {};\n\n Object.keys(data).forEach(dataKey => {\n const value = data[dataKey];\n serialized[dataKey] = typeof value === 'string' ? value : JSON.stringify(value);\n });\n\n return serialized;\n },\n\n /**\n * Convert js severity level in event.level and event.breadcrumbs to more widely supported levels.\n * @param event\n * @returns Event with more widely supported Severity level strings\n */\n _processLevels(event: Event): Event {\n const processed: Event = {\n ...event,\n level: event.level ? this._processLevel(event.level) : undefined,\n breadcrumbs: event.breadcrumbs?.map(breadcrumb => ({\n ...breadcrumb,\n level: breadcrumb.level ? this._processLevel(breadcrumb.level) : undefined,\n })),\n };\n\n return processed;\n },\n\n /**\n * Convert js severity level which has critical and log to more widely supported levels.\n * @param level\n * @returns More widely supported Severity level strings\n */\n _processLevel(level: SeverityLevel): SeverityLevel {\n if (level == ('log' as SeverityLevel)) {\n return 'debug' as SeverityLevel;\n }\n return level;\n },\n\n /**\n * Checks whether the RNSentry module is loaded.\n */\n _isModuleLoaded(module: Spec | undefined): module is Spec {\n return !!module;\n },\n\n _setPrimitiveProcessor: function (processor: (value: Primitive) => any): void {\n this.primitiveProcessor = processor;\n },\n\n _DisabledNativeError: new SentryError('Native is disabled'),\n\n _NativeClientError: new SentryError(\"Native Client is not available, can't start on native.\"),\n\n enableNative: true,\n nativeIsReady: false,\n platform: Platform.OS,\n};\n\n/**\n * Fethces the data from the given uri in Uint8Array format.\n * @param uri string\n * @returns Uint8Array | null\n */\nexport async function getDataFromUri(uri: string): Promise<Uint8Array | null> {\n return NATIVE.getDataFromUri(uri);\n}\n"]}
package/ios/RNSentry.mm CHANGED
@@ -723,6 +723,22 @@ RCT_EXPORT_METHOD(setTag : (NSString *)key value : (NSString *)value)
723
723
  configureScope:^(SentryScope *_Nonnull scope) { [scope setTagValue:value forKey:key]; }];
724
724
  }
725
725
 
726
+ RCT_EXPORT_METHOD(setAttribute : (NSString *)key value : (NSString *)value)
727
+ {
728
+ // TODO(alwx): This is not implemented in sentry-cocoa yet
729
+ /*[SentrySDKWrapper
730
+ configureScope:^(SentryScope *_Nonnull scope) { [scope setAttribute:value forKey:key]; }];*/
731
+ }
732
+
733
+ RCT_EXPORT_METHOD(setAttributes : (NSDictionary *)attributes)
734
+ {
735
+ // TODO(alwx): This is not implemented in sentry-cocoa yet
736
+ /*[SentrySDKWrapper configureScope:^(SentryScope *_Nonnull scope) {
737
+ [attributes enumerateKeysAndObjectsUsingBlock:^(
738
+ NSString *key, NSString *value, BOOL *stop) { [scope setAttribute:value forKey:key]; }];
739
+ }];*/
740
+ }
741
+
726
742
  RCT_EXPORT_METHOD(crash) { [SentrySDKWrapper crash]; }
727
743
 
728
744
  RCT_EXPORT_METHOD(
@@ -37,6 +37,14 @@ NS_ASSUME_NONNULL_BEGIN
37
37
  + (void)setEnableSessionReplayInUnreliableEnvironment:(BOOL)enabled
38
38
  sentryOptions:(SentryOptions *)sentryOptions;
39
39
 
40
+ /**
41
+ * Configures iOS UI profiling options on SentryOptions
42
+ * @param profilingOptions Dictionary containing profiling configuration
43
+ * @param sentryOptions The SentryOptions instance to configure
44
+ */
45
+ + (void)configureProfilingWithOptions:(NSDictionary *)profilingOptions
46
+ sentryOptions:(SentryOptions *)sentryOptions;
47
+
40
48
  @end
41
49
 
42
50
  NS_ASSUME_NONNULL_END
@@ -1,4 +1,5 @@
1
1
  #import "RNSentryExperimentalOptions.h"
2
+ #import <Sentry/SentryProfilingConditionals.h>
2
3
  @import Sentry;
3
4
 
4
5
  @implementation RNSentryExperimentalOptions
@@ -36,4 +37,45 @@
36
37
  sentryOptions.experimental.enableSessionReplayInUnreliableEnvironment = enabled;
37
38
  }
38
39
 
40
+ + (void)configureProfilingWithOptions:(NSDictionary *)profilingOptions
41
+ sentryOptions:(SentryOptions *)sentryOptions
42
+ {
43
+ #if SENTRY_TARGET_PROFILING_SUPPORTED
44
+ if (sentryOptions == nil || profilingOptions == nil) {
45
+ return;
46
+ }
47
+
48
+ sentryOptions.configureProfiling = ^(SentryProfileOptions *_Nonnull profiling) {
49
+ // Set session sample rate
50
+ id profileSessionSampleRate = profilingOptions[@"profileSessionSampleRate"];
51
+ if (profileSessionSampleRate != nil &&
52
+ [profileSessionSampleRate isKindOfClass:[NSNumber class]]) {
53
+ profiling.sessionSampleRate = [profileSessionSampleRate floatValue];
54
+ NSLog(@"Sentry: UI Profiling sessionSampleRate set to: %.2f",
55
+ profiling.sessionSampleRate);
56
+ }
57
+
58
+ // Set lifecycle mode
59
+ NSString *lifecycle = profilingOptions[@"lifecycle"];
60
+ if ([lifecycle isKindOfClass:[NSString class]]) {
61
+ if ([lifecycle caseInsensitiveCompare:@"manual"] == NSOrderedSame) {
62
+ profiling.lifecycle = SentryProfileLifecycleManual;
63
+ NSLog(@"Sentry: UI Profiling Lifecycle set to MANUAL");
64
+ } else if ([lifecycle caseInsensitiveCompare:@"trace"] == NSOrderedSame) {
65
+ profiling.lifecycle = SentryProfileLifecycleTrace;
66
+ NSLog(@"Sentry: UI Profiling Lifecycle set to TRACE");
67
+ }
68
+ }
69
+
70
+ // Set profile app starts
71
+ id startOnAppStart = profilingOptions[@"startOnAppStart"];
72
+ if (startOnAppStart != nil && [startOnAppStart isKindOfClass:[NSNumber class]]) {
73
+ profiling.profileAppStarts = [startOnAppStart boolValue];
74
+ NSLog(@"Sentry: UI Profiling profileAppStarts set to %@",
75
+ profiling.profileAppStarts ? @"YES" : @"NO");
76
+ }
77
+ };
78
+ #endif
79
+ }
80
+
39
81
  @end
@@ -3,4 +3,4 @@
3
3
  NSString *const NATIVE_SDK_NAME = @"sentry.cocoa.react-native";
4
4
  NSString *const REACT_NATIVE_SDK_NAME = @"sentry.javascript.react-native";
5
5
  NSString *const REACT_NATIVE_SDK_PACKAGE_NAME = @"npm:@sentry/react-native";
6
- NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"7.10.0";
6
+ NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"7.12.0";
@@ -106,6 +106,13 @@
106
106
  [experiments[@"enableUnhandledCPPExceptionsV2"] boolValue];
107
107
  [RNSentryExperimentalOptions setEnableUnhandledCPPExceptionsV2:enableUnhandledCPPExceptions
108
108
  sentryOptions:sentryOptions];
109
+
110
+ // Configure iOS UI Profiling
111
+ NSDictionary *profilingOptions = experiments[@"profilingOptions"];
112
+ if (profilingOptions != nil && [profilingOptions isKindOfClass:[NSDictionary class]]) {
113
+ [RNSentryExperimentalOptions configureProfilingWithOptions:profilingOptions
114
+ sentryOptions:sentryOptions];
115
+ }
109
116
  }
110
117
 
111
118
  if (isSessionReplayEnabled) {