@sentry/react-native 6.13.1 → 7.0.0-alpha.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.
- package/RNSentry.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +11 -14
- package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
- package/dist/js/client.d.ts +12 -0
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +24 -1
- package/dist/js/client.js.map +1 -1
- package/dist/js/feedback/FeedbackWidget.d.ts +1 -1
- package/dist/js/feedback/FeedbackWidget.d.ts.map +1 -1
- package/dist/js/feedback/FeedbackWidget.js +18 -17
- package/dist/js/feedback/FeedbackWidget.js.map +1 -1
- package/dist/js/feedback/FeedbackWidget.types.d.ts +29 -29
- package/dist/js/feedback/FeedbackWidget.types.d.ts.map +1 -1
- package/dist/js/feedback/FeedbackWidget.types.js.map +1 -1
- package/dist/js/feedback/FeedbackWidgetManager.d.ts.map +1 -1
- package/dist/js/feedback/FeedbackWidgetManager.js +6 -3
- package/dist/js/feedback/FeedbackWidgetManager.js.map +1 -1
- package/dist/js/feedback/defaults.d.ts +1 -1
- package/dist/js/feedback/defaults.d.ts.map +1 -1
- package/dist/js/feedback/defaults.js.map +1 -1
- package/dist/js/feedback/integration.d.ts +1 -1
- package/dist/js/feedback/integration.d.ts.map +1 -1
- package/dist/js/feedback/integration.js.map +1 -1
- package/dist/js/feedback/utils.js +2 -2
- package/dist/js/feedback/utils.js.map +1 -1
- package/dist/js/index.d.ts +2 -2
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +1 -1
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/debugsymbolicator.js +2 -1
- package/dist/js/integrations/debugsymbolicator.js.map +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.d.ts.map +1 -1
- package/dist/js/integrations/debugsymbolicatorutils.js +12 -2
- package/dist/js/integrations/debugsymbolicatorutils.js.map +1 -1
- package/dist/js/integrations/default.d.ts.map +1 -1
- package/dist/js/integrations/default.js +9 -5
- package/dist/js/integrations/default.js.map +1 -1
- package/dist/js/integrations/expocontext.d.ts +18 -0
- package/dist/js/integrations/expocontext.d.ts.map +1 -1
- package/dist/js/integrations/expocontext.js +20 -12
- package/dist/js/integrations/expocontext.js.map +1 -1
- package/dist/js/integrations/nativelinkederrors.js +4 -3
- package/dist/js/integrations/nativelinkederrors.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +2 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/screenshot.js +3 -3
- package/dist/js/integrations/screenshot.js.map +1 -1
- package/dist/js/integrations/spotlight.d.ts.map +1 -1
- package/dist/js/integrations/spotlight.js +8 -4
- package/dist/js/integrations/spotlight.js.map +1 -1
- package/dist/js/integrations/viewhierarchy.js +2 -1
- package/dist/js/integrations/viewhierarchy.js.map +1 -1
- package/dist/js/options.d.ts +8 -1
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/profiling/cache.d.ts +1 -1
- package/dist/js/profiling/convertHermesProfile.d.ts.map +1 -1
- package/dist/js/profiling/convertHermesProfile.js +18 -5
- package/dist/js/profiling/convertHermesProfile.js.map +1 -1
- package/dist/js/profiling/debugid.d.ts.map +1 -1
- package/dist/js/profiling/debugid.js +9 -1
- package/dist/js/profiling/debugid.js.map +1 -1
- package/dist/js/profiling/hermes.d.ts +1 -1
- package/dist/js/profiling/hermes.d.ts.map +1 -1
- package/dist/js/profiling/integration.js +2 -1
- package/dist/js/profiling/integration.js.map +1 -1
- package/dist/js/profiling/utils.d.ts.map +1 -1
- package/dist/js/profiling/utils.js +15 -17
- package/dist/js/profiling/utils.js.map +1 -1
- package/dist/js/replay/CustomMask.js +1 -1
- package/dist/js/replay/CustomMask.js.map +1 -1
- package/dist/js/replay/mobilereplay.js +2 -1
- package/dist/js/replay/mobilereplay.js.map +1 -1
- package/dist/js/scopeSync.d.ts.map +1 -1
- package/dist/js/scopeSync.js +7 -1
- package/dist/js/scopeSync.js.map +1 -1
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +2 -2
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tools/ModulesCollector.js +1 -0
- package/dist/js/tools/ModulesCollector.js.map +1 -1
- package/dist/js/tools/collectModules.js +1 -0
- package/dist/js/tools/collectModules.js.map +1 -1
- package/dist/js/tools/enableLogger.js +1 -0
- package/dist/js/tools/enableLogger.js.map +1 -1
- package/dist/js/tools/metroMiddleware.js +2 -1
- package/dist/js/tools/metroMiddleware.js.map +1 -1
- package/dist/js/tools/metroconfig.js +5 -3
- package/dist/js/tools/metroconfig.js.map +1 -1
- package/dist/js/tools/sentryBabelTransformer.js +1 -0
- package/dist/js/tools/sentryBabelTransformer.js.map +1 -1
- package/dist/js/tools/sentryBabelTransformerUtils.js +1 -0
- package/dist/js/tools/sentryBabelTransformerUtils.js.map +1 -1
- package/dist/js/tools/sentryMetroSerializer.js +1 -0
- package/dist/js/tools/sentryMetroSerializer.js.map +1 -1
- package/dist/js/tools/utils.js +1 -0
- package/dist/js/tools/utils.js.map +1 -1
- package/dist/js/tools/vendor/expo/expoconfig.js +1 -0
- package/dist/js/tools/vendor/expo/expoconfig.js.map +1 -1
- package/dist/js/tools/vendor/metro/metroBabelTransformer.js +1 -0
- package/dist/js/tools/vendor/metro/metroBabelTransformer.js.map +1 -1
- package/dist/js/tools/vendor/metro/utils.js +1 -0
- package/dist/js/tools/vendor/metro/utils.js.map +1 -1
- package/dist/js/touchevents.d.ts.map +1 -1
- package/dist/js/touchevents.js +4 -0
- package/dist/js/touchevents.js.map +1 -1
- package/dist/js/tracing/integrations/appStart.d.ts +1 -1
- package/dist/js/tracing/integrations/appStart.d.ts.map +1 -1
- package/dist/js/tracing/integrations/appStart.js +9 -2
- package/dist/js/tracing/integrations/appStart.js.map +1 -1
- package/dist/js/tracing/integrations/nativeFrames.js.map +1 -1
- package/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
- package/dist/js/tracing/integrations/stalltracking.d.ts.map +1 -1
- package/dist/js/tracing/integrations/timeToDisplayIntegration.d.ts.map +1 -1
- package/dist/js/tracing/integrations/timeToDisplayIntegration.js +14 -10
- package/dist/js/tracing/integrations/timeToDisplayIntegration.js.map +1 -1
- package/dist/js/tracing/onSpanEndUtils.d.ts +1 -1
- package/dist/js/tracing/onSpanEndUtils.d.ts.map +1 -1
- package/dist/js/tracing/onSpanEndUtils.js +2 -1
- package/dist/js/tracing/onSpanEndUtils.js.map +1 -1
- package/dist/js/tracing/reactnativenavigation.js +1 -1
- package/dist/js/tracing/reactnativenavigation.js.map +1 -1
- package/dist/js/tracing/reactnativeprofiler.d.ts +3 -1
- package/dist/js/tracing/reactnativeprofiler.d.ts.map +1 -1
- package/dist/js/tracing/reactnativeprofiler.js +2 -1
- package/dist/js/tracing/reactnativeprofiler.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.d.ts +4 -1
- package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
- package/dist/js/tracing/reactnativetracing.js +5 -1
- package/dist/js/tracing/reactnativetracing.js.map +1 -1
- package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigation.js +5 -4
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- package/dist/js/tracing/span.js +3 -3
- package/dist/js/tracing/span.js.map +1 -1
- package/dist/js/tracing/timeToDisplayFallback.d.ts +1 -1
- package/dist/js/tracing/timeToDisplayFallback.d.ts.map +1 -1
- package/dist/js/tracing/timeToDisplayFallback.js.map +1 -1
- package/dist/js/transports/encodePolyfill.d.ts.map +1 -1
- package/dist/js/transports/encodePolyfill.js +5 -5
- package/dist/js/transports/encodePolyfill.js.map +1 -1
- package/dist/js/utils/AsyncExpiringMap.d.ts.map +1 -1
- package/dist/js/utils/AsyncExpiringMap.js +8 -4
- package/dist/js/utils/AsyncExpiringMap.js.map +1 -1
- package/dist/js/utils/envelope.d.ts.map +1 -1
- package/dist/js/utils/envelope.js +1 -2
- package/dist/js/utils/envelope.js.map +1 -1
- package/dist/js/utils/environment.d.ts.map +1 -1
- package/dist/js/utils/environment.js +5 -6
- package/dist/js/utils/environment.js.map +1 -1
- package/dist/js/vendor/base64-js/fromByteArray.d.ts.map +1 -1
- package/dist/js/vendor/base64-js/fromByteArray.js +6 -0
- package/dist/js/vendor/base64-js/fromByteArray.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.d.ts.map +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.js +3 -2
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentryVersion.m +1 -1
- package/package.json +12 -13
- package/plugin/build/withSentry.js +1 -1
- package/plugin/build/withSentryAndroidGradlePlugin.js +1 -1
- package/ts3.8/dist/js/client.d.ts +12 -0
- package/ts3.8/dist/js/feedback/FeedbackWidget.d.ts +1 -1
- package/ts3.8/dist/js/feedback/FeedbackWidget.types.d.ts +29 -29
- package/ts3.8/dist/js/feedback/defaults.d.ts +1 -1
- package/ts3.8/dist/js/feedback/integration.d.ts +1 -1
- package/ts3.8/dist/js/index.d.ts +2 -2
- package/ts3.8/dist/js/integrations/expocontext.d.ts +18 -0
- package/ts3.8/dist/js/options.d.ts +8 -1
- package/ts3.8/dist/js/profiling/cache.d.ts +1 -1
- package/ts3.8/dist/js/profiling/hermes.d.ts +1 -1
- package/ts3.8/dist/js/tracing/integrations/appStart.d.ts +1 -1
- package/ts3.8/dist/js/tracing/integrations/stalltracking.d.ts +1 -1
- package/ts3.8/dist/js/tracing/onSpanEndUtils.d.ts +1 -1
- package/ts3.8/dist/js/tracing/reactnativeprofiler.d.ts +3 -1
- package/ts3.8/dist/js/tracing/reactnativetracing.d.ts +4 -1
- package/ts3.8/dist/js/tracing/timeToDisplayFallback.d.ts +1 -1
- package/ts3.8/dist/js/version.d.ts +1 -1
|
@@ -7,8 +7,13 @@ export const OTA_UPDATES_CONTEXT_KEY = 'ota_updates';
|
|
|
7
7
|
/** Load device context from expo modules. */
|
|
8
8
|
export const expoContextIntegration = () => {
|
|
9
9
|
let _expoUpdatesContextCached;
|
|
10
|
-
function setup() {
|
|
11
|
-
|
|
10
|
+
function setup(client) {
|
|
11
|
+
client.on('afterInit', () => {
|
|
12
|
+
if (!client.getOptions().enableNative) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
setExpoUpdatesNativeContext();
|
|
16
|
+
});
|
|
12
17
|
}
|
|
13
18
|
function setExpoUpdatesNativeContext() {
|
|
14
19
|
if (!isExpo() || isExpoGo()) {
|
|
@@ -47,7 +52,10 @@ export const expoContextIntegration = () => {
|
|
|
47
52
|
processEvent,
|
|
48
53
|
};
|
|
49
54
|
};
|
|
50
|
-
|
|
55
|
+
/**
|
|
56
|
+
* @internal Exposed for testing purposes
|
|
57
|
+
*/
|
|
58
|
+
export function getExpoUpdatesContext() {
|
|
51
59
|
const expoUpdates = getExpoUpdates();
|
|
52
60
|
if (!expoUpdates) {
|
|
53
61
|
return {
|
|
@@ -60,19 +68,19 @@ function getExpoUpdatesContext() {
|
|
|
60
68
|
is_emergency_launch: !!expoUpdates.isEmergencyLaunch,
|
|
61
69
|
is_using_embedded_assets: !!expoUpdates.isUsingEmbeddedAssets,
|
|
62
70
|
};
|
|
63
|
-
if (typeof expoUpdates.updateId === 'string') {
|
|
64
|
-
updatesContext.update_id = expoUpdates.updateId;
|
|
71
|
+
if (typeof expoUpdates.updateId === 'string' && expoUpdates.updateId) {
|
|
72
|
+
updatesContext.update_id = expoUpdates.updateId.toLowerCase();
|
|
65
73
|
}
|
|
66
|
-
if (typeof expoUpdates.channel === 'string') {
|
|
67
|
-
updatesContext.channel = expoUpdates.channel;
|
|
74
|
+
if (typeof expoUpdates.channel === 'string' && expoUpdates.channel) {
|
|
75
|
+
updatesContext.channel = expoUpdates.channel.toLowerCase();
|
|
68
76
|
}
|
|
69
|
-
if (typeof expoUpdates.runtimeVersion === 'string') {
|
|
70
|
-
updatesContext.runtime_version = expoUpdates.runtimeVersion;
|
|
77
|
+
if (typeof expoUpdates.runtimeVersion === 'string' && expoUpdates.runtimeVersion) {
|
|
78
|
+
updatesContext.runtime_version = expoUpdates.runtimeVersion.toLowerCase();
|
|
71
79
|
}
|
|
72
|
-
if (typeof expoUpdates.checkAutomatically === 'string') {
|
|
73
|
-
updatesContext.check_automatically = expoUpdates.checkAutomatically;
|
|
80
|
+
if (typeof expoUpdates.checkAutomatically === 'string' && expoUpdates.checkAutomatically) {
|
|
81
|
+
updatesContext.check_automatically = expoUpdates.checkAutomatically.toLowerCase();
|
|
74
82
|
}
|
|
75
|
-
if (typeof expoUpdates.emergencyLaunchReason === 'string') {
|
|
83
|
+
if (typeof expoUpdates.emergencyLaunchReason === 'string' && expoUpdates.emergencyLaunchReason) {
|
|
76
84
|
updatesContext.emergency_launch_reason = expoUpdates.emergencyLaunchReason;
|
|
77
85
|
}
|
|
78
86
|
if (typeof expoUpdates.launchDuration === 'number') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expocontext.js","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"expocontext.js","sourceRoot":"","sources":["../../../src/js/integrations/expocontext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGxG,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,CAAC,M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EAAE,UAAU,CAAC,YAAY;QACrC,WAAW,EAAE,UAAU,CAAC,WAAW;KACpC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB;IACvB,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,KAAK,EAAE,UAAU,CAAC,SAAS;QAC3B,OAAO,EAAE,UAAU,CAAC,SAAS;QAC7B,IAAI,EAAE,UAAU,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import { type DeviceContext, type Event, type Integration, type OsContext, logger } from '@sentry/core';\n\nimport type { ReactNativeClient } from '../client';\nimport { isExpo, isExpoGo } from '../utils/environment';\nimport { getExpoDevice, getExpoUpdates } from '../utils/expomodules';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'ExpoContext';\n\nexport const OTA_UPDATES_CONTEXT_KEY = 'ota_updates';\n\n/** Load device context from expo modules. */\nexport const expoContextIntegration = (): Integration => {\n let _expoUpdatesContextCached: ExpoUpdatesContext | undefined;\n\n function setup(client: ReactNativeClient): void {\n client.on('afterInit', () => {\n if (!client.getOptions().enableNative) {\n return;\n }\n\n setExpoUpdatesNativeContext();\n });\n }\n\n function setExpoUpdatesNativeContext(): void {\n if (!isExpo() || isExpoGo()) {\n return;\n }\n\n const expoUpdates = getExpoUpdatesContextCached();\n\n try {\n // Ensures native errors and crashes have the same context as JS errors\n NATIVE.setContext(OTA_UPDATES_CONTEXT_KEY, expoUpdates);\n } catch (error) {\n logger.error('Error setting Expo updates context:', error);\n }\n }\n\n function processEvent(event: Event): Event {\n if (!isExpo()) {\n return event;\n }\n\n addExpoGoContext(event);\n addExpoUpdatesContext(event);\n return event;\n }\n\n function addExpoUpdatesContext(event: Event): void {\n event.contexts = event.contexts || {};\n event.contexts[OTA_UPDATES_CONTEXT_KEY] = {\n ...getExpoUpdatesContextCached(),\n };\n }\n\n function getExpoUpdatesContextCached(): ExpoUpdatesContext {\n if (_expoUpdatesContextCached) {\n return _expoUpdatesContextCached;\n }\n\n return (_expoUpdatesContextCached = getExpoUpdatesContext());\n }\n\n return {\n name: INTEGRATION_NAME,\n setup,\n processEvent,\n };\n};\n\n/**\n * @internal Exposed for testing purposes\n */\nexport function getExpoUpdatesContext(): ExpoUpdatesContext {\n const expoUpdates = getExpoUpdates();\n if (!expoUpdates) {\n return {\n is_enabled: false,\n };\n }\n\n const updatesContext: ExpoUpdatesContext = {\n is_enabled: !!expoUpdates.isEnabled,\n is_embedded_launch: !!expoUpdates.isEmbeddedLaunch,\n is_emergency_launch: !!expoUpdates.isEmergencyLaunch,\n is_using_embedded_assets: !!expoUpdates.isUsingEmbeddedAssets,\n };\n\n if (typeof expoUpdates.updateId === 'string' && expoUpdates.updateId) {\n updatesContext.update_id = expoUpdates.updateId.toLowerCase();\n }\n if (typeof expoUpdates.channel === 'string' && expoUpdates.channel) {\n updatesContext.channel = expoUpdates.channel.toLowerCase();\n }\n if (typeof expoUpdates.runtimeVersion === 'string' && expoUpdates.runtimeVersion) {\n updatesContext.runtime_version = expoUpdates.runtimeVersion.toLowerCase();\n }\n if (typeof expoUpdates.checkAutomatically === 'string' && expoUpdates.checkAutomatically) {\n updatesContext.check_automatically = expoUpdates.checkAutomatically.toLowerCase();\n }\n if (typeof expoUpdates.emergencyLaunchReason === 'string' && expoUpdates.emergencyLaunchReason) {\n updatesContext.emergency_launch_reason = expoUpdates.emergencyLaunchReason;\n }\n if (typeof expoUpdates.launchDuration === 'number') {\n updatesContext.launch_duration = expoUpdates.launchDuration;\n }\n if (expoUpdates.createdAt instanceof Date) {\n updatesContext.created_at = expoUpdates.createdAt.toISOString();\n }\n return updatesContext;\n}\n\nfunction addExpoGoContext(event: Event): void {\n if (!isExpoGo()) {\n return;\n }\n\n const expoDeviceContext = getExpoDeviceContext();\n if (expoDeviceContext) {\n event.contexts = event.contexts || {};\n event.contexts.device = { ...expoDeviceContext, ...event.contexts.device };\n }\n\n const expoOsContext = getExpoOsContext();\n if (expoOsContext) {\n event.contexts = event.contexts || {};\n event.contexts.os = { ...expoOsContext, ...event.contexts.os };\n }\n}\n\n/**\n * Returns the Expo Device context if present\n */\nfunction getExpoDeviceContext(): DeviceContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n name: expoDevice.deviceName,\n simulator: !expoDevice?.isDevice,\n model: expoDevice.modelName,\n manufacturer: expoDevice.manufacturer,\n memory_size: expoDevice.totalMemory,\n };\n}\n\n/**\n * Returns the Expo OS context if present\n */\nfunction getExpoOsContext(): OsContext | undefined {\n const expoDevice = getExpoDevice();\n\n if (!expoDevice) {\n return undefined;\n }\n\n return {\n build: expoDevice.osBuildId,\n version: expoDevice.osVersion,\n name: expoDevice.osName,\n };\n}\n\ntype ExpoUpdatesContext = Partial<{\n is_enabled: boolean;\n is_embedded_launch: boolean;\n is_emergency_launch: boolean;\n is_using_embedded_assets: boolean;\n update_id: string;\n channel: string;\n runtime_version: string;\n check_automatically: string;\n emergency_launch_reason: string;\n launch_duration: number;\n created_at: string;\n}>;\n"]}
|
|
@@ -19,7 +19,8 @@ export const nativeLinkedErrorsIntegration = (options = {}) => {
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
function preprocessEvent(event, hint, client, limit, key) {
|
|
22
|
-
|
|
22
|
+
var _a;
|
|
23
|
+
if (!((_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) || !hint || !isInstanceOf(hint.originalException, Error)) {
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
26
|
const parser = client.getOptions().stackParser;
|
|
@@ -107,10 +108,10 @@ function exceptionFromAppleStackReturnAddresses(objCException) {
|
|
|
107
108
|
type: objCException.name,
|
|
108
109
|
value: objCException.message,
|
|
109
110
|
stacktrace: {
|
|
110
|
-
frames: (nativeStackFrames
|
|
111
|
+
frames: (nativeStackFrames === null || nativeStackFrames === void 0 ? void 0 : nativeStackFrames.frames.reverse()) || [],
|
|
111
112
|
},
|
|
112
113
|
},
|
|
113
|
-
appleDebugImages: (nativeStackFrames
|
|
114
|
+
appleDebugImages: (nativeStackFrames === null || nativeStackFrames === void 0 ? void 0 : nativeStackFrames.debugMetaImages) || [],
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
117
|
let nativePackage = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativelinkederrors.js","sourceRoot":"","sources":["../../../src/js/integrations/nativelinkederrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAYrD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGrE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAE9C,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,aAAa,GAAG,CAAC,CAAC;AAOxB;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,UAAwC,EAAE,EAAe,EAAE;IACvG,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,WAAW,CAAC;IACvC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,aAAa,CAAC;IAE7C,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAS,EAAE;YACpB,OAAO;QACT,CAAC;QACD,eAAe,EAAE,CAAC,KAAY,EAAE,IAAe,EAAE,MAAc,EAAQ,EAAE,CACvE,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC;KACnD,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,eAAe,CAAC,KAAY,EAAE,IAA2B,EAAE,MAAc,EAAE,KAAa,EAAE,GAAW
|
|
1
|
+
{"version":3,"file":"nativelinkederrors.js","sourceRoot":"","sources":["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AAY,CAAC,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;aACtG,CAAA,CACJ;iBACA,OAAO,EAAE;SACb;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,sCAAsC,CAAC,aAI/C;IAIC,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAErF,OAAO;QACL,cAAc,EAAE;YACd,IAAI,EAAE,aAAa,CAAC,IAAI;YACxB,KAAK,EAAE,aAAa,CAAC,OAAO;YAC5B,UAAU,EAAE;gBACV,MAAM,EAAE,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,MAAM,CAAC,OAAO,EAAE,KAAI,EAAE;aAClD;SACF;QACD,gBAAgB,EAAE,CAAC,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,eAAgC,KAAI,EAAE;KAC7E,CAAC;AACJ,CAAC;AAED,IAAI,aAAa,GAAkB,IAAI,CAAC;AACxC;;GAEG;AACH,SAAS,kBAAkB;IACzB,IAAI,aAAa,KAAK,IAAI,EAAE;QAC1B,aAAa,GAAG,MAAM,CAAC,sBAAsB,EAAE,CAAC;KACjD;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,gBAA0B;IACxD,OAAO,MAAM,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import { exceptionFromError } from '@sentry/browser';\nimport type {\n Client,\n DebugImage,\n Event,\n EventHint,\n Exception,\n ExtendedError,\n Integration,\n StackFrame,\n StackParser,\n} from '@sentry/core';\nimport { isInstanceOf, isPlainObject, isString } from '@sentry/core';\n\nimport type { NativeStackFrames } from '../NativeRNSentry';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'NativeLinkedErrors';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\ninterface LinkedErrorsOptions {\n key: string;\n limit: number;\n}\n\n/**\n * Processes JS and RN native linked errors.\n */\nexport const nativeLinkedErrorsIntegration = (options: Partial<LinkedErrorsOptions> = {}): Integration => {\n const key = options.key || DEFAULT_KEY;\n const limit = options.limit || DEFAULT_LIMIT;\n\n return {\n name: INTEGRATION_NAME,\n setupOnce: (): void => {\n // noop\n },\n preprocessEvent: (event: Event, hint: EventHint, client: Client): void =>\n preprocessEvent(event, hint, client, limit, key),\n };\n};\n\nfunction preprocessEvent(event: Event, hint: EventHint | undefined, client: Client, limit: number, key: string): void {\n if (!event.exception?.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n const parser = client.getOptions().stackParser;\n\n const { exceptions: linkedErrors, debugImages } = walkErrorTree(\n parser,\n limit,\n hint.originalException as ExtendedError,\n key,\n );\n event.exception.values = [...event.exception.values, ...linkedErrors];\n\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n event.debug_meta.images.push(...(debugImages || []));\n}\n\n/**\n * Walks linked errors and created Sentry exceptions chain.\n * Collects debug images from native errors stack frames.\n */\nfunction walkErrorTree(\n parser: StackParser,\n limit: number,\n error: ExtendedError,\n key: string,\n exceptions: Exception[] = [],\n debugImages: DebugImage[] = [],\n): {\n exceptions: Exception[];\n debugImages?: DebugImage[];\n} {\n const linkedError = error[key];\n if (!linkedError || exceptions.length + 1 >= limit) {\n return {\n exceptions,\n debugImages,\n };\n }\n\n let exception: Exception;\n let exceptionDebugImages: DebugImage[] | undefined;\n if (isString(linkedError)) {\n exception = {\n value: linkedError,\n };\n } else if ('stackElements' in linkedError) {\n // isJavaException\n exception = exceptionFromJavaStackElements(linkedError);\n } else if ('stackReturnAddresses' in linkedError) {\n // isObjCException\n const { appleException, appleDebugImages } = exceptionFromAppleStackReturnAddresses(linkedError);\n exception = appleException;\n exceptionDebugImages = appleDebugImages;\n } else if (isInstanceOf(linkedError, Error)) {\n exception = exceptionFromError(parser, error[key]);\n } else if (isPlainObject(linkedError)) {\n exception = {\n type: typeof linkedError.name === 'string' ? linkedError.name : undefined,\n value: typeof linkedError.message === 'string' ? linkedError.message : undefined,\n };\n } else {\n return {\n exceptions,\n debugImages,\n };\n }\n\n return walkErrorTree(\n parser,\n limit,\n linkedError,\n key,\n [...exceptions, exception],\n [...debugImages, ...(exceptionDebugImages || [])],\n );\n}\n\n/**\n * Converts a Java Throwable to an SentryException\n */\nfunction exceptionFromJavaStackElements(javaThrowable: {\n name: string;\n message: string;\n stackElements: {\n className: string;\n fileName: string;\n methodName: string;\n lineNumber: number;\n }[];\n}): Exception {\n const nativePackage = fetchNativePackage();\n return {\n type: javaThrowable.name,\n value: javaThrowable.message,\n stacktrace: {\n frames: javaThrowable.stackElements\n .map(\n stackElement =>\n <StackFrame>{\n platform: 'java',\n module: stackElement.className,\n filename: stackElement.fileName,\n lineno: stackElement.lineNumber >= 0 ? stackElement.lineNumber : undefined,\n function: stackElement.methodName,\n in_app: nativePackage !== null && stackElement.className.startsWith(nativePackage) ? true : undefined,\n },\n )\n .reverse(),\n },\n };\n}\n\n/**\n * Converts StackAddresses to a SentryException with DebugMetaImages\n */\nfunction exceptionFromAppleStackReturnAddresses(objCException: {\n name: string;\n message: string;\n stackReturnAddresses: number[];\n}): {\n appleException: Exception;\n appleDebugImages: DebugImage[];\n} {\n const nativeStackFrames = fetchNativeStackFrames(objCException.stackReturnAddresses);\n\n return {\n appleException: {\n type: objCException.name,\n value: objCException.message,\n stacktrace: {\n frames: nativeStackFrames?.frames.reverse() || [],\n },\n },\n appleDebugImages: (nativeStackFrames?.debugMetaImages as DebugImage[]) || [],\n };\n}\n\nlet nativePackage: string | null = null;\n/**\n * Fetches the native package/image name from the native layer\n */\nfunction fetchNativePackage(): string | null {\n if (nativePackage === null) {\n nativePackage = NATIVE.fetchNativePackageName();\n }\n return nativePackage;\n}\n\n/**\n * Fetches native debug image information on iOS\n */\nfunction fetchNativeStackFrames(instructionsAddr: number[]): NativeStackFrames | null {\n return NATIVE.fetchNativeStackFramesBy(instructionsAddr);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeerrorhandlers.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,WAAW,EAAiB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"reactnativeerrorhandlers.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,WAAW,EAAiB,MAAM,cAAc,CAAC;AAU1E,uCAAuC;AACvC,UAAU,+BAA+B;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAOD,2CAA2C;AAC3C,eAAO,MAAM,mCAAmC,aACrC,QAAQ,+BAA+B,CAAC,KAChD,WAWF,CAAC"}
|
|
@@ -66,13 +66,14 @@ function attachUnhandledRejectionHandler() {
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
function setupErrorUtilsGlobalHandler() {
|
|
69
|
+
var _a;
|
|
69
70
|
let handlingFatal = false;
|
|
70
71
|
const errorUtils = RN_GLOBAL_OBJ.ErrorUtils;
|
|
71
72
|
if (!errorUtils) {
|
|
72
73
|
logger.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');
|
|
73
74
|
return;
|
|
74
75
|
}
|
|
75
|
-
const defaultHandler = errorUtils.getGlobalHandler
|
|
76
|
+
const defaultHandler = (_a = errorUtils.getGlobalHandler) === null || _a === void 0 ? void 0 : _a.call(errorUtils);
|
|
76
77
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
77
78
|
errorUtils.setGlobalHandler((error, isFatal) => __awaiter(this, void 0, void 0, function* () {
|
|
78
79
|
// We want to handle fatals, but only in production mode.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3G,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAEjH,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAcpD,2CAA2C;AAC3C,MAAM,CAAC,MAAM,mCAAmC,GAAG,CACjD,UAAoD,EAAE,EACzC,EAAE;IACf,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE,CACd,KAAK,iBACH,OAAO,EAAE,IAAI,EACb,oBAAoB,EAAE,IAAI,EAC1B,kBAAkB,EAAE,IAAI,IACrB,OAAO,EACV;KACL,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,KAAK,CAAC,OAAwC;IACrD,OAAO,CAAC,oBAAoB,IAAI,gCAAgC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC7F,OAAO,CAAC,OAAO,IAAI,4BAA4B,EAAE,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,SAAS,gCAAgC,CAAC,kBAA2B;IACnE,IAAI,kBAAkB,EAAE;QAC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AAI;gBACb,IAAI,EAAE,SAAS;aAChB,CAAC,CAAC;SACJ;QAED,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEjC,IAAI,OAAO,EAAE;YACX,gFAAgF;YAChF,mCAAmC;YACnC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC/B,OAAO;SACR;QAED,KAAK,MAAM,CAAC,KAAK,CAAE,MAAM,CAAC,UAAU,EAA+B,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,IAAI,CAC/F,GAAG,EAAE;YACH,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACjC,CAAC,EACD,CAAC,MAAe,EAAE,EAAE;YAClB,MAAM,CAAC,KAAK,CAAC,uFAAuF,EAAE,MAAM,CAAC,CAAC;QAChH,CAAC,CACF,CAAC;IACJ,CAAC,CAAA,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { EventHint, Integration, SeverityLevel } from '@sentry/core';\nimport { addExceptionMechanism, captureException, getClient, getCurrentScope, logger } from '@sentry/core';\n\nimport type { ReactNativeClientOptions } from '../options';\nimport { createSyntheticError, isErrorLike } from '../utils/error';\nimport { RN_GLOBAL_OBJ } from '../utils/worldwide';\nimport { checkPromiseAndWarn, polyfillPromise, requireRejectionTracking } from './reactnativeerrorhandlersutils';\n\nconst INTEGRATION_NAME = 'ReactNativeErrorHandlers';\n\n/** ReactNativeErrorHandlers Options */\ninterface ReactNativeErrorHandlersOptions {\n onerror: boolean;\n onunhandledrejection: boolean;\n patchGlobalPromise: boolean;\n}\n\ninterface PromiseRejectionTrackingOptions {\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n/** ReactNativeErrorHandlers Integration */\nexport const reactNativeErrorHandlersIntegration = (\n options: Partial<ReactNativeErrorHandlersOptions> = {},\n): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () =>\n setup({\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n }),\n };\n};\n\nfunction setup(options: ReactNativeErrorHandlersOptions): void {\n options.onunhandledrejection && setupUnhandledRejectionsTracking(options.patchGlobalPromise);\n options.onerror && setupErrorUtilsGlobalHandler();\n}\n\n/**\n * Setup unhandled promise rejection tracking\n */\nfunction setupUnhandledRejectionsTracking(patchGlobalPromise: boolean): void {\n if (patchGlobalPromise) {\n polyfillPromise();\n }\n\n attachUnhandledRejectionHandler();\n checkPromiseAndWarn();\n}\n\nfunction attachUnhandledRejectionHandler(): void {\n const tracking = requireRejectionTracking();\n\n const promiseRejectionTrackingOptions: PromiseRejectionTrackingOptions = {\n onUnhandled: (id, rejection = {}) => {\n // eslint-disable-next-line no-console\n console.warn(`Possible Unhandled Promise Rejection (id: ${id}):\\n${rejection}`);\n },\n onHandled: id => {\n // eslint-disable-next-line no-console\n console.warn(\n `Promise Rejection Handled (id: ${id})\\n` +\n 'This means you can ignore any previous messages of the form ' +\n `\"Possible Unhandled Promise Rejection (id: ${id}):\"`,\n );\n },\n };\n\n tracking.enable({\n allRejections: true,\n onUnhandled: (id: string, error: unknown) => {\n if (__DEV__) {\n promiseRejectionTrackingOptions.onUnhandled(id, error);\n }\n\n captureException(error, {\n data: { id },\n originalException: error,\n syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),\n mechanism: { handled: true, type: 'onunhandledrejection' },\n });\n },\n onHandled: (id: string) => {\n promiseRejectionTrackingOptions.onHandled(id);\n },\n });\n}\n\nfunction setupErrorUtilsGlobalHandler(): void {\n let handlingFatal = false;\n\n const errorUtils = RN_GLOBAL_OBJ.ErrorUtils;\n if (!errorUtils) {\n logger.warn('ErrorUtils not found. Can be caused by different environment for example react-native-web.');\n return;\n }\n\n const defaultHandler = errorUtils.getGlobalHandler?.();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n errorUtils.setGlobalHandler(async (error: any, isFatal?: boolean) => {\n // We want to handle fatals, but only in production mode.\n const shouldHandleFatal = isFatal && !__DEV__;\n if (shouldHandleFatal) {\n if (handlingFatal) {\n logger.log('Encountered multiple fatals in a row. The latest:', error);\n return;\n }\n handlingFatal = true;\n }\n\n const client = getClient();\n\n if (!client) {\n logger.error('Sentry client is missing, the error event might be lost.', error);\n\n // If there is no client something is fishy, anyway we call the default handler\n defaultHandler(error, isFatal);\n\n return;\n }\n\n const hint: EventHint = {\n originalException: error,\n attachments: getCurrentScope().getScopeData().attachments,\n };\n const event = await client.eventFromException(error, hint);\n\n if (isFatal) {\n event.level = 'fatal' as SeverityLevel;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n } else {\n event.level = 'error';\n\n addExceptionMechanism(event, {\n handled: true,\n type: 'generic',\n });\n }\n\n client.captureEvent(event, hint);\n\n if (__DEV__) {\n // If in dev, we call the default handler anyway and hope the error will be sent\n // Just for a better dev experience\n defaultHandler(error, isFatal);\n return;\n }\n\n void client.flush((client.getOptions() as ReactNativeClientOptions).shutdownTimeout || 2000).then(\n () => {\n defaultHandler(error, isFatal);\n },\n (reason: unknown) => {\n logger.error('[ReactNativeErrorHandlers] Error while flushing the event cache after uncaught error.', reason);\n },\n );\n });\n}\n"]}
|
|
@@ -20,10 +20,10 @@ export const screenshotIntegration = () => {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
function processEvent(event, hint, client) {
|
|
23
|
-
var _a, _b;
|
|
23
|
+
var _a, _b, _c;
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const hasException = event.exception
|
|
26
|
-
if (!hasException || ((
|
|
25
|
+
const hasException = ((_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) && event.exception.values.length > 0;
|
|
26
|
+
if (!hasException || ((_c = (_b = client.getOptions()).beforeScreenshot) === null || _c === void 0 ? void 0 : _c.call(_b, event, hint)) === false) {
|
|
27
27
|
return event;
|
|
28
28
|
}
|
|
29
29
|
const screenshots = yield NATIVE.captureScreenshot();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":";;;;;;;;;AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,uCAAuC;AACvC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAgB,EAAE;IACrD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF,SAAe,YAAY,CAAC,KAAY,EAAE,IAAe,EAAE,MAAyB;;;QAClF,MAAM,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../../src/js/integrations/screenshot.ts"],"names":[],"mappings":";;;;;;;;;AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,uCAAuC;AACvC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAgB,EAAE;IACrD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF,SAAe,YAAY,CAAC,KAAY,EAAE,IAAe,EAAE,MAAyB;;;QAClF,MAAM,YAAY,GAAG,CAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,KAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAClF,IAAI,CAAC,YAAY,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,UAAU,EAAE,EAAC,gBAAgB,mDAAG,KAAK,EAAE,IAAI,CAAC,MAAK,KAAK,EAAE;YAClF,OAAO,KAAK,CAAC;SACd;QAED,MAAM,WAAW,GAAkC,MAAM,MAAM,CAAC,iBAAiB,EAAE,CAAC;QACpF,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YACzC,IAAI,CAAC,WAAW,GAAG,CAAC,GAAG,WAAW,EAAE,GAAG,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,KAAI,EAAE,CAAC,CAAC,CAAC;SACnE;QAED,OAAO,KAAK,CAAC;;CACd","sourcesContent":["import type { Event, EventHint, Integration } from '@sentry/core';\n\nimport type { ReactNativeClient } from '../client';\nimport type { Screenshot as ScreenshotAttachment } from '../wrapper';\nimport { NATIVE } from '../wrapper';\n\nconst INTEGRATION_NAME = 'Screenshot';\n\n/** Adds screenshots to error events */\nexport const screenshotIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent,\n };\n};\n\nasync function processEvent(event: Event, hint: EventHint, client: ReactNativeClient): Promise<Event> {\n const hasException = event.exception?.values && event.exception.values.length > 0;\n if (!hasException || client.getOptions().beforeScreenshot?.(event, hint) === false) {\n return event;\n }\n\n const screenshots: ScreenshotAttachment[] | null = await NATIVE.captureScreenshot();\n if (screenshots && screenshots.length > 0) {\n hint.attachments = [...screenshots, ...(hint?.attachments || [])];\n }\n\n return event;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spotlight.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/spotlight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyD,WAAW,EAAE,MAAM,cAAc,CAAC;AAMvG,KAAK,sCAAsC,GAAG;IAC5C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,UAAmC,GACpC,GAAE,sCAA2C,GAAG,WAAW,CAc3D;
|
|
1
|
+
{"version":3,"file":"spotlight.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/spotlight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyD,WAAW,EAAE,MAAM,cAAc,CAAC;AAMvG,KAAK,sCAAsC,GAAG;IAC5C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,UAAmC,GACpC,GAAE,sCAA2C,GAAG,WAAW,CAc3D;AAkDD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAY7C"}
|
|
@@ -52,19 +52,23 @@ function sendEnvelopesToSidecar(client, sidecarUrl) {
|
|
|
52
52
|
xhr.send(serializeEnvelope(spotlightEnvelope));
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
+
const DEFAULT_SIDECAR_URL = 'http://localhost:8969/stream';
|
|
55
56
|
/**
|
|
56
57
|
* Gets the default Spotlight sidecar URL.
|
|
57
58
|
*/
|
|
58
59
|
export function getDefaultSidecarUrl() {
|
|
59
|
-
var _a;
|
|
60
|
+
var _a, _b;
|
|
60
61
|
try {
|
|
61
|
-
const { url } = (_a = ReactNativeLibraries.Devtools) === null || _a === void 0 ? void 0 : _a.getDevServer();
|
|
62
|
+
const { url } = (_b = (_a = ReactNativeLibraries.Devtools) === null || _a === void 0 ? void 0 : _a.getDevServer()) !== null && _b !== void 0 ? _b : {};
|
|
63
|
+
if (!url) {
|
|
64
|
+
return DEFAULT_SIDECAR_URL;
|
|
65
|
+
}
|
|
62
66
|
return `http://${getHostnameFromString(url)}:8969/stream`;
|
|
63
67
|
}
|
|
64
68
|
catch (_oO) {
|
|
65
69
|
// We can't load devserver URL
|
|
66
70
|
}
|
|
67
|
-
return
|
|
71
|
+
return DEFAULT_SIDECAR_URL;
|
|
68
72
|
}
|
|
69
73
|
/**
|
|
70
74
|
* React Native implementation of the URL class is missing the `hostname` property.
|
|
@@ -72,7 +76,7 @@ export function getDefaultSidecarUrl() {
|
|
|
72
76
|
function getHostnameFromString(urlString) {
|
|
73
77
|
const regex = /^(?:\w+:)?\/\/([^/:]+)(:\d+)?(.*)$/;
|
|
74
78
|
const matches = urlString.match(regex);
|
|
75
|
-
if (matches
|
|
79
|
+
if (matches === null || matches === void 0 ? void 0 : matches[1]) {
|
|
76
80
|
return matches[1];
|
|
77
81
|
}
|
|
78
82
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spotlight.js","sourceRoot":"","sources":["../../../src/js/integrations/spotlight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAYrE;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,UAAU,GAAG,oBAAoB,EAAE,MACO,EAAE;IAC5C,MAAM,CAAC,IAAI,CAAC,+BAA+B,EAAE,UAAU,CAAC,CAAC;IAEzD,OAAO;QACL,IAAI,EAAE,WAAW;QAEjB,SAAS;YACP,qBAAqB;QACvB,CAAC;QAED,KAAK,CAAC,MAAmD;YACvD,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,MAAc,EAAE,UAAkB;IAC/C,sBAAsB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,sBAAsB,CAAC,MAAc,EAAE,UAAkB;IAChE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;QACd,OAAO;KACR;IAED,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,CAAC,gBAA0B,EAAE,EAAE;QACzD,yEAAyE;QACzE,MAAM,iBAAiB,GAAa,CAAC,GAAG,gBAAgB,CAAC,CAAC;QAC1D,MAAM,aAAa,GAAG,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,MA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K,GAAG,oCAAoC,CAAC;IACnD,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEvC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,CAAC,CAAC,EAAE;QAChB,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;KACnB;SAAM;QACL,qBAAqB;QACrB,OAAO,IAAI,CAAC;KACb;AACH,CAAC","sourcesContent":["import type { BaseTransportOptions, Client, ClientOptions, Envelope, Integration } from '@sentry/core';\nimport { logger, serializeEnvelope } from '@sentry/core';\n\nimport { ReactNativeLibraries } from '../utils/rnlibraries';\nimport { createStealthXhr, XHR_READYSTATE_DONE } from '../utils/xhr';\n\ntype SpotlightReactNativeIntegrationOptions = {\n /**\n * The URL of the Sidecar instance to connect and forward events to.\n * If not set, Spotlight will try to connect to the Sidecar running on localhost:8969.\n *\n * @default \"http://localhost:8969/stream\"\n */\n sidecarUrl?: string;\n};\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n */\nexport function spotlightIntegration({\n sidecarUrl = getDefaultSidecarUrl(),\n}: SpotlightReactNativeIntegrationOptions = {}): Integration {\n logger.info('[Spotlight] Using Sidecar URL', sidecarUrl);\n\n return {\n name: 'Spotlight',\n\n setupOnce(): void {\n // nothing to do here\n },\n\n setup(client: Client<ClientOptions<BaseTransportOptions>>): void {\n setup(client, sidecarUrl);\n },\n };\n}\n\nfunction setup(client: Client, sidecarUrl: string): void {\n sendEnvelopesToSidecar(client, sidecarUrl);\n}\n\nfunction sendEnvelopesToSidecar(client: Client, sidecarUrl: string): void {\n if (!client.on) {\n return;\n }\n\n client.on('beforeEnvelope', (originalEnvelope: Envelope) => {\n // TODO: This is a workaround for spotlight/sidecar not supporting images\n const spotlightEnvelope: Envelope = [...originalEnvelope];\n const envelopeItems = [...originalEnvelope[1]].filter(\n item => typeof item[0].content_type !== 'string' || !item[0].content_type.startsWith('image'),\n );\n\n spotlightEnvelope[1] = envelopeItems as Envelope[1];\n\n const xhr = createStealthXhr();\n if (!xhr) {\n logger.error('[Spotlight] Sentry SDK can not create XHR object');\n return;\n }\n\n xhr.open('POST', sidecarUrl, true);\n xhr.setRequestHeader('Content-Type', 'application/x-sentry-envelope');\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n const status = xhr.status;\n if (status === 0 || (status >= 200 && status < 400)) {\n // The request has been completed successfully\n } else {\n // Handle the error\n logger.error(\n \"[Spotlight] Sentry SDK can't connect to Spotlight is it running? See https://spotlightjs.com to download it.\",\n new Error(xhr.statusText),\n );\n }\n }\n };\n\n xhr.send(serializeEnvelope(spotlightEnvelope));\n });\n}\n\nconst DEFAULT_SIDECAR_URL = 'http://localhost:8969/stream';\n\n/**\n * Gets the default Spotlight sidecar URL.\n */\nexport function getDefaultSidecarUrl(): string {\n try {\n const { url } = ReactNativeLibraries.Devtools?.getDevServer() ?? {};\n if (!url) {\n return DEFAULT_SIDECAR_URL;\n }\n\n return `http://${getHostnameFromString(url)}:8969/stream`;\n } catch (_oO) {\n // We can't load devserver URL\n }\n return DEFAULT_SIDECAR_URL;\n}\n\n/**\n * React Native implementation of the URL class is missing the `hostname` property.\n */\nfunction getHostnameFromString(urlString: string): string | null {\n const regex = /^(?:\\w+:)?\\/\\/([^/:]+)(:\\d+)?(.*)$/;\n const matches = urlString.match(regex);\n\n if (matches?.[1]) {\n return matches[1];\n } else {\n // Invalid URL format\n return null;\n }\n}\n"]}
|
|
@@ -24,8 +24,9 @@ export const viewHierarchyIntegration = () => {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
function processEvent(event, hint) {
|
|
27
|
+
var _a;
|
|
27
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const hasException = event.exception
|
|
29
|
+
const hasException = ((_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) && event.exception.values.length > 0;
|
|
29
30
|
if (!hasException) {
|
|
30
31
|
return event;
|
|
31
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewhierarchy.js","sourceRoot":"","sources":["../../../src/js/integrations/viewhierarchy.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,QAAQ,GAAW,qBAAqB,CAAC;AAC/C,MAAM,WAAW,GAAW,kBAAkB,CAAC;AAC/C,MAAM,cAAc,GAAG,sBAAsD,CAAC;AAE9E,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,yCAAyC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAgB,EAAE;IACxD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF,SAAe,YAAY,CAAC,KAAY,EAAE,IAAe
|
|
1
|
+
{"version":3,"file":"viewhierarchy.js","sourceRoot":"","sources":["../../../src/js/integrations/viewhierarchy.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,QAAQ,GAAW,qBAAqB,CAAC;AAC/C,MAAM,WAAW,GAAW,kBAAkB,CAAC;AAC/C,MAAM,cAAc,GAAG,sBAAsD,CAAC;AAE9E,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,yCAAyC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAgB,EAAE;IACxD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAEF,SAAe,YAAY,CAAC,KAAY,EAAE,IAAe;;;QACvD,MAAM,YAAY,GAAG,CAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,KAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAClF,IAAI,CAAC,YAAY,EAAE;YACjB,OAAO,KAAK,CAAC;SACd;QAED,IAAI,aAAa,GAAsB,IAAI,CAAC;QAC5C,IAAI;YACF,aAAa,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;SACnD;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,CAAC,CAAC,CAAC;SAC9D;QAED,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,WAAW,GAAG;gBACjB;oBACE,QAAQ;oBACR,WAAW;oBACX,cAAc;oBACd,IAAI,EAAE,aAAa;iBACpB;gBACD,GAAG,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,KAAI,EAAE,CAAC;aAC7B,CAAC;SACH;QAED,OAAO,KAAK,CAAC;;CACd","sourcesContent":["import type { Attachment, Event, EventHint, Integration } from '@sentry/core';\nimport { logger } from '@sentry/core';\n\nimport { NATIVE } from '../wrapper';\n\nconst filename: string = 'view-hierarchy.json';\nconst contentType: string = 'application/json';\nconst attachmentType = 'event.view_hierarchy' as Attachment['attachmentType'];\n\nconst INTEGRATION_NAME = 'ViewHierarchy';\n\n/** Adds ViewHierarchy to error events */\nexport const viewHierarchyIntegration = (): Integration => {\n return {\n name: INTEGRATION_NAME,\n setupOnce: () => {\n // noop\n },\n processEvent,\n };\n};\n\nasync function processEvent(event: Event, hint: EventHint): Promise<Event> {\n const hasException = event.exception?.values && event.exception.values.length > 0;\n if (!hasException) {\n return event;\n }\n\n let viewHierarchy: Uint8Array | null = null;\n try {\n viewHierarchy = await NATIVE.fetchViewHierarchy();\n } catch (e) {\n logger.error('Failed to get view hierarchy from native.', e);\n }\n\n if (viewHierarchy) {\n hint.attachments = [\n {\n filename,\n contentType,\n attachmentType,\n data: viewHierarchy,\n },\n ...(hint?.attachments || []),\n ];\n }\n\n return event;\n}\n"]}
|
package/dist/js/options.d.ts
CHANGED
|
@@ -198,6 +198,13 @@ export interface BaseReactNativeOptions {
|
|
|
198
198
|
* 1.0 will record all sessions and 0 will record none.
|
|
199
199
|
*/
|
|
200
200
|
replaysOnErrorSampleRate?: number;
|
|
201
|
+
/**
|
|
202
|
+
* Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause
|
|
203
|
+
* problems for sending events from command line applications. Setting it too
|
|
204
|
+
* high can cause the application to block for users with network connectivity
|
|
205
|
+
* problems.
|
|
206
|
+
*/
|
|
207
|
+
shutdownTimeout?: number;
|
|
201
208
|
/**
|
|
202
209
|
* Options which are in beta, or otherwise not guaranteed to be stable.
|
|
203
210
|
*/
|
|
@@ -240,7 +247,7 @@ export interface ReactNativeClientOptions extends Omit<ClientOptions<ReactNative
|
|
|
240
247
|
}
|
|
241
248
|
export interface ReactNativeWrapperOptions {
|
|
242
249
|
/** Props for the root React profiler */
|
|
243
|
-
profilerProps?: ProfilerProps
|
|
250
|
+
profilerProps?: Omit<ProfilerProps, 'updateProps' | 'children' | 'name'>;
|
|
244
251
|
/** Props for the root touch event boundary */
|
|
245
252
|
touchEventBoundaryProps?: TouchEventBoundaryProps;
|
|
246
253
|
}
|
package/dist/js/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CA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"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA+RvD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAoB;IAC3D,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;QACpC,yCAAyC;QACzC,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,aAAa,IAAI,aAAa,CAAC,YAAY,KAAK,MAAM,EAAE;QAC1D,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { makeFetchTransport } from '@sentry/browser';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/core';\nimport type { Profiler } from '@sentry/react';\nimport type * as React from 'react';\nimport { Platform } from 'react-native';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { getExpoConstants } from './utils/expomodules';\n\ntype ProfilerProps = React.ComponentProps<typeof Profiler>;\ntype BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable NDK on Android\n *\n * @default true\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n */\n enableNdkScopeSync?: boolean;\n\n /** When enabled, all the threads are automatically attached to all logged events on Android */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n */\n enableWatchdogTerminationTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n */\n appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n\n /**\n * Sets a callback which is executed before capturing screenshots. Only\n * relevant if `attachScreenshot` is set to true. When false is returned\n * from the function, no screenshot will be attached.\n */\n beforeScreenshot?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * Track the app start time by adding measurements to the first route transaction. If there is no routing instrumentation\n * an app start transaction will be started.\n *\n * Requires performance monitoring to be enabled.\n *\n * @default true\n */\n enableAppStartTracking?: boolean;\n\n /**\n * Track the slow and frozen frames in the application. Enabling this options will add\n * slow and frozen frames measurements to all created root spans (transactions).\n *\n * @default true\n */\n enableNativeFramesTracking?: boolean;\n\n /**\n * Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.\n *\n * @default true\n */\n enableStallTracking?: boolean;\n\n /**\n * Trace User Interaction events like touch and gestures.\n *\n * @default false\n */\n enableUserInteractionTracing?: boolean;\n\n /**\n * The sample rate for profiling\n * 1.0 will profile all transactions and 0 will profile none.\n */\n profilesSampleRate?: number;\n\n /**\n * The sample rate for session-long replays.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * The sample rate for sessions that has had an error occur.\n * This is independent of `sessionSampleRate`.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: {\n [key: string]: unknown;\n\n /**\n * @deprecated Use `replaysSessionSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * @deprecated Use `replaysOnErrorSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysOnErrorSampleRate?: number;\n };\n\n /**\n * This options changes the placement of the attached stacktrace of `captureMessage` in the event.\n *\n * @default false\n * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.\n */\n useThreadsForMessageStack?: boolean;\n}\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: ProfilerProps;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n const expoConstants = getExpoConstants();\n if (expoConstants && expoConstants.appOwnership === 'expo') {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/js/options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAuSvD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAoB;IAC3D,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;QACpC,yCAAyC;QACzC,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;QACtD,oEAAoE;QACpE,OAAO,KAAK,CAAC;KACd;IAED,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,IAAI,aAAa,IAAI,aAAa,CAAC,YAAY,KAAK,MAAM,EAAE;QAC1D,yDAAyD;QACzD,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { makeFetchTransport } from '@sentry/browser';\nimport type { CaptureContext, ClientOptions, Event, EventHint, Options } from '@sentry/core';\nimport type { Profiler } from '@sentry/react';\nimport type * as React from 'react';\nimport { Platform } from 'react-native';\n\nimport type { TouchEventBoundaryProps } from './touchevents';\nimport { getExpoConstants } from './utils/expomodules';\n\ntype ProfilerProps = React.ComponentProps<typeof Profiler>;\ntype BrowserTransportOptions = Parameters<typeof makeFetchTransport>[0];\n\nexport interface BaseReactNativeOptions {\n /**\n * Enables native transport + device info + offline caching.\n * Be careful, disabling this also breaks automatic release setting.\n * This means you have to manage setting the release yourself.\n * Defaults to `true`.\n */\n enableNative?: boolean;\n\n /**\n * Enables native crashHandling. This only works if `enableNative` is `true`.\n * Defaults to `true`.\n */\n enableNativeCrashHandling?: boolean;\n\n /**\n * Initializes the native SDK on init.\n * Set this to `false` if you have an existing native SDK and don't want to re-initialize.\n *\n * NOTE: Be careful and only use this if you know what you are doing.\n * If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured.\n * Also, make sure the DSN on both the React Native side and the native side are the same one.\n * We strongly recommend checking the documentation if you need to use this.\n *\n * @default true\n */\n autoInitializeNativeSdk?: boolean;\n\n /** Should the native nagger alert be shown or not. */\n enableNativeNagger?: boolean;\n\n /** Should sessions be tracked to Sentry Health or not. */\n enableAutoSessionTracking?: boolean;\n\n /** The interval to end a session if the App goes to the background. */\n sessionTrackingIntervalMillis?: number;\n\n /** Enable NDK on Android\n *\n * @default true\n */\n enableNdk?: boolean;\n\n /** Enable scope sync from Java to NDK on Android\n * Only has an effect if `enableNdk` is `true`.\n */\n enableNdkScopeSync?: boolean;\n\n /** When enabled, all the threads are automatically attached to all logged events on Android */\n attachThreads?: boolean;\n\n /**\n * When enabled, certain personally identifiable information (PII) is added by active integrations.\n *\n * @default false\n */\n sendDefaultPii?: boolean;\n\n /**\n * Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.\n */\n onReady?: (response: {\n /** `true` if the native SDK has been initialized, `false` otherwise. */\n didCallNativeInit: boolean;\n }) => void;\n\n /** Enable auto performance tracking by default. Renamed from `enableAutoPerformanceTracking` in v5. */\n enableAutoPerformanceTracing?: boolean;\n\n /**\n * Enables Out of Memory Tracking for iOS and macCatalyst.\n * See the following link for more information and possible restrictions:\n * https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/\n *\n * Renamed from `enableOutOfMemoryTracking` in v5.\n *\n * @default true\n */\n enableWatchdogTerminationTracking?: boolean;\n\n /**\n * Set data to the inital scope\n * @deprecated Use `Sentry.configureScope(...)`\n */\n initialScope?: CaptureContext;\n\n /**\n * When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked.\n * If you run into issues with Promise polyfills such as `core-js`, make sure you polyfill after Sentry is initialized.\n * Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections\n *\n * When disabled, this option will not disable unhandled rejection tracking. Set `onunhandledrejection: false` on the `ReactNativeErrorHandlers` integration instead.\n *\n * @default true\n */\n patchGlobalPromise?: boolean;\n\n /**\n * The max cache items for capping the number of envelopes.\n *\n * @default 30\n */\n maxCacheItems?: number;\n\n /**\n * When enabled, the SDK tracks when the application stops responding for a specific amount of\n * time defined by the `appHangTimeoutInterval` option.\n *\n * iOS only\n *\n * @default true\n */\n enableAppHangTracking?: boolean;\n\n /**\n * The minimum amount of time an app should be unresponsive to be classified as an App Hanging.\n * The actual amount may be a little longer.\n * Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted.\n * Value should be in seconds.\n *\n * iOS only\n *\n * @default 2\n */\n appHangTimeoutInterval?: number;\n\n /**\n * The max queue size for capping the number of envelopes waiting to be sent by Transport.\n */\n maxQueueSize?: number;\n\n /**\n * When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.\n *\n * @default false\n */\n attachScreenshot?: boolean;\n\n /**\n * When enabled Sentry includes the current view hierarchy in the error attachments.\n *\n * @default false\n */\n attachViewHierarchy?: boolean;\n\n /**\n * When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS.\n * [Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/)\n * is needed to capture HTTP Errors on Android.\n *\n * @default false\n */\n enableCaptureFailedRequests?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n\n /**\n * Sets a callback which is executed before capturing screenshots. Only\n * relevant if `attachScreenshot` is set to true. When false is returned\n * from the function, no screenshot will be attached.\n */\n beforeScreenshot?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * Track the app start time by adding measurements to the first route transaction. If there is no routing instrumentation\n * an app start transaction will be started.\n *\n * Requires performance monitoring to be enabled.\n *\n * @default true\n */\n enableAppStartTracking?: boolean;\n\n /**\n * Track the slow and frozen frames in the application. Enabling this options will add\n * slow and frozen frames measurements to all created root spans (transactions).\n *\n * @default true\n */\n enableNativeFramesTracking?: boolean;\n\n /**\n * Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.\n *\n * @default true\n */\n enableStallTracking?: boolean;\n\n /**\n * Trace User Interaction events like touch and gestures.\n *\n * @default false\n */\n enableUserInteractionTracing?: boolean;\n\n /**\n * The sample rate for profiling\n * 1.0 will profile all transactions and 0 will profile none.\n */\n profilesSampleRate?: number;\n\n /**\n * The sample rate for session-long replays.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * The sample rate for sessions that has had an error occur.\n * This is independent of `sessionSampleRate`.\n * 1.0 will record all sessions and 0 will record none.\n */\n replaysOnErrorSampleRate?: number;\n\n /**\n * Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause\n * problems for sending events from command line applications. Setting it too\n * high can cause the application to block for users with network connectivity\n * problems.\n */\n shutdownTimeout?: number;\n\n /**\n * Options which are in beta, or otherwise not guaranteed to be stable.\n */\n _experiments?: {\n [key: string]: unknown;\n\n /**\n * @deprecated Use `replaysSessionSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysSessionSampleRate?: number;\n\n /**\n * @deprecated Use `replaysOnErrorSampleRate` in the options root instead.\n *\n * This will be removed in the next major version.\n */\n replaysOnErrorSampleRate?: number;\n };\n\n /**\n * This options changes the placement of the attached stacktrace of `captureMessage` in the event.\n *\n * @default false\n * @deprecated This option will be removed in the next major version. Use `beforeSend` instead.\n */\n useThreadsForMessageStack?: boolean;\n}\n\nexport interface ReactNativeTransportOptions extends BrowserTransportOptions {\n /**\n * @deprecated use `maxQueueSize` in the root of the SDK options.\n */\n bufferSize?: number;\n}\n\n/**\n * Configuration options for the Sentry ReactNative SDK.\n * @see ReactNativeFrontend for more information.\n */\n\nexport interface ReactNativeOptions\n extends Omit<Options<ReactNativeTransportOptions>, '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeClientOptions\n extends Omit<ClientOptions<ReactNativeTransportOptions>, 'tunnel' | '_experiments'>,\n BaseReactNativeOptions {}\n\nexport interface ReactNativeWrapperOptions {\n /** Props for the root React profiler */\n profilerProps?: Omit<ProfilerProps, 'updateProps' | 'children' | 'name'>;\n\n /** Props for the root touch event boundary */\n touchEventBoundaryProps?: TouchEventBoundaryProps;\n}\n\n/**\n * If the user has not explicitly set `enableNativeNagger`\n * the function enables native nagging based on the current\n * environment.\n */\nexport function shouldEnableNativeNagger(userOptions: unknown): boolean {\n if (typeof userOptions === 'boolean') {\n // User can override the default behavior\n return userOptions;\n }\n\n if (Platform.OS === 'web' || Platform.OS === 'windows') {\n // We don't want to nag on known platforms that don't support native\n return false;\n }\n\n const expoConstants = getExpoConstants();\n if (expoConstants && expoConstants.appOwnership === 'expo') {\n // If the app is running in Expo Go, we don't want to nag\n return false;\n }\n\n return true;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AndroidCombinedProfileEvent, CombinedProfileEvent } from './types';
|
|
2
2
|
export declare const PROFILE_QUEUE: {
|
|
3
|
-
get: (key: string) => AndroidCombinedProfileEvent | CombinedProfileEvent;
|
|
3
|
+
get: (key: string) => AndroidCombinedProfileEvent | CombinedProfileEvent | undefined;
|
|
4
4
|
add: (key: string, value: AndroidCombinedProfileEvent | CombinedProfileEvent) => void;
|
|
5
5
|
delete: (key: string) => boolean;
|
|
6
6
|
clear: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertHermesProfile.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/convertHermesProfile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,cAAc,EAAE,eAAe,EAAkB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIhH,OAAO,KAAK,KAAK,MAAM,MAAM,UAAU,CAAC;AAExC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AASnD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,CAAC,OAAO,GAAG,mBAAmB,GAAG,IAAI,CA0ChG;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,EAC9B,sBAAsB,GAAE,MAAgC,GACvD;IACD,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACvC,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;CAC1B,
|
|
1
|
+
{"version":3,"file":"convertHermesProfile.d.ts","sourceRoot":"","sources":["../../../src/js/profiling/convertHermesProfile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,cAAc,EAAE,eAAe,EAAkB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIhH,OAAO,KAAK,KAAK,MAAM,MAAM,UAAU,CAAC;AAExC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AASnD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,CAAC,OAAO,GAAG,mBAAmB,GAAG,IAAI,CA0ChG;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,EAC9B,sBAAsB,GAAE,MAAgC,GACvD;IACD,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACvC,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;CAC1B,CAyCA;AAkED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,GAAG,cAAc,CA8BhF"}
|
|
@@ -59,10 +59,19 @@ export function convertToSentryProfile(hermesProfile) {
|
|
|
59
59
|
* @returns the mapped Sentry samples, the set of Hermes stack frame IDs, and the set of JS thread IDs
|
|
60
60
|
*/
|
|
61
61
|
export function mapSamples(hermesSamples, maxElapsedSinceStartNs = MAX_PROFILE_DURATION_NS) {
|
|
62
|
+
const samples = [];
|
|
62
63
|
const jsThreads = new Set();
|
|
63
64
|
const hermesStacks = new Set();
|
|
64
|
-
const
|
|
65
|
-
|
|
65
|
+
const firstSample = hermesSamples[0];
|
|
66
|
+
if (!firstSample) {
|
|
67
|
+
logger.warn('[Profiling] No samples found in profile.');
|
|
68
|
+
return {
|
|
69
|
+
samples,
|
|
70
|
+
hermesStacks,
|
|
71
|
+
jsThreads,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const start = Number(firstSample.ts);
|
|
66
75
|
for (const hermesSample of hermesSamples) {
|
|
67
76
|
jsThreads.add(hermesSample.tid);
|
|
68
77
|
hermesStacks.add(hermesSample.sf);
|
|
@@ -97,8 +106,11 @@ function mapFrames(hermesStackFrames) {
|
|
|
97
106
|
if (!Object.prototype.hasOwnProperty.call(hermesStackFrames, key)) {
|
|
98
107
|
continue;
|
|
99
108
|
}
|
|
100
|
-
|
|
101
|
-
|
|
109
|
+
const hermesStackFrame = hermesStackFrames[key];
|
|
110
|
+
if (hermesStackFrame) {
|
|
111
|
+
hermesStackFrameIdToSentryFrameIdMap.set(Number(key), frames.length);
|
|
112
|
+
frames.push(parseHermesJSStackFrame(hermesStackFrame));
|
|
113
|
+
}
|
|
102
114
|
}
|
|
103
115
|
return {
|
|
104
116
|
frames,
|
|
@@ -111,6 +123,7 @@ function mapFrames(hermesStackFrames) {
|
|
|
111
123
|
* @returns the mapped Sentry stacks and a map from Hermes stack IDs to Sentry stack IDs (indices in the stacks array)
|
|
112
124
|
*/
|
|
113
125
|
function mapStacks(hermesStacks, hermesStackFrames, hermesStackFrameIdToSentryFrameIdMap) {
|
|
126
|
+
var _a;
|
|
114
127
|
const hermesStackToSentryStackMap = new Map();
|
|
115
128
|
const stacks = [];
|
|
116
129
|
for (const hermesStackFunctionFrameId of hermesStacks) {
|
|
@@ -121,7 +134,7 @@ function mapStacks(hermesStacks, hermesStackFrames, hermesStackFrameIdToSentryFr
|
|
|
121
134
|
while (currentHermesFrameId !== undefined) {
|
|
122
135
|
const sentryFrameId = hermesStackFrameIdToSentryFrameIdMap.get(currentHermesFrameId);
|
|
123
136
|
sentryFrameId !== undefined && stack.push(sentryFrameId);
|
|
124
|
-
currentHermesFrameId = hermesStackFrames[currentHermesFrameId]
|
|
137
|
+
currentHermesFrameId = (_a = hermesStackFrames[currentHermesFrameId]) === null || _a === void 0 ? void 0 : _a.parent;
|
|
125
138
|
}
|
|
126
139
|
stacks.push(stack);
|
|
127
140
|
}
|