@sentry/react-native 7.1.0 → 7.3.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/libs/replay-stubs.jar +0 -0
- package/android/replay-stubs/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryVersion.java +1 -1
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +4 -7
- package/dist/js/client.js.map +1 -1
- package/dist/js/integrations/logEnricherIntegration.js +28 -9
- package/dist/js/integrations/logEnricherIntegration.js.map +1 -1
- package/dist/js/playground/modal.d.ts.map +1 -1
- package/dist/js/playground/modal.js +2 -2
- package/dist/js/playground/modal.js.map +1 -1
- package/dist/js/replay/mobilereplay.d.ts +1 -0
- package/dist/js/replay/mobilereplay.d.ts.map +1 -1
- package/dist/js/replay/mobilereplay.js +15 -7
- package/dist/js/replay/mobilereplay.js.map +1 -1
- package/dist/js/tools/metroconfig.d.ts +1 -1
- package/dist/js/tools/metroconfig.d.ts.map +1 -1
- package/dist/js/tools/metroconfig.js.map +1 -1
- package/dist/js/tools/utils.d.ts.map +1 -1
- package/dist/js/tools/utils.js +2 -8
- package/dist/js/tools/utils.js.map +1 -1
- package/dist/js/tools/vendor/metro/countLines.d.ts +3 -0
- package/dist/js/tools/vendor/metro/countLines.d.ts.map +1 -0
- package/dist/js/tools/vendor/metro/countLines.js +27 -0
- package/dist/js/tools/vendor/metro/countLines.js.map +1 -0
- package/dist/js/tools/vendor/metro/utils.d.ts.map +1 -1
- package/dist/js/tools/vendor/metro/utils.js +17 -8
- package/dist/js/tools/vendor/metro/utils.js.map +1 -1
- package/dist/js/touchevents.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.js.map +1 -1
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- package/dist/js/version.d.ts +1 -1
- package/dist/js/version.js +1 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +1 -0
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry+fetchNativeStack.m +1 -2
- package/ios/RNSentry.h +1 -2
- package/ios/RNSentry.mm +48 -68
- package/ios/RNSentryExperimentalOptions.h +7 -0
- package/ios/RNSentryExperimentalOptions.m +8 -0
- package/ios/RNSentryVersion.m +1 -1
- package/ios/Replay/RNSentryReplayMask.mm +1 -2
- package/ios/Replay/RNSentryReplayUnmask.mm +1 -2
- package/package.json +10 -10
- package/plugin/build/withSentryAndroidGradlePlugin.d.ts +1 -1
- package/plugin/build/withSentryAndroidGradlePlugin.js +1 -1
- package/scripts/expo-upload-sourcemaps.js +1 -1
- package/scripts/sentry-xcode.sh +2 -1
- package/sentry.gradle +8 -2
- package/ts3.8/dist/js/replay/mobilereplay.d.ts +1 -0
- package/ts3.8/dist/js/version.d.ts +1 -1
package/dist/js/wrapper.js.map
CHANGED
|
@@ -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,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,C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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 { 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};\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 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 = 'application/vnd.sentry.items.log+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 };\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 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 { beforeSend, beforeBreadcrumb, beforeSendTransaction, integrations, ignoreErrors, ...filteredOptions } =\n options;\n /* eslint-enable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\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, segment, ...otherKeys } = user;\n // TODO: Update native impl to use geo\n const requiredUser: Omit<RequiredKeysUser, 'geo'> = {\n id,\n ip_address,\n email,\n username,\n segment,\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,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,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 { 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};\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 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 = 'application/vnd.sentry.items.log+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 };\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 { beforeSend, beforeBreadcrumb, beforeSendTransaction, integrations, ignoreErrors, ...filteredOptions } =\n options;\n /* eslint-enable @typescript-eslint/unbound-method,@typescript-eslint/no-unused-vars */\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, segment, ...otherKeys } = user;\n // TODO: Update native impl to use geo\n const requiredUser: Omit<RequiredKeysUser, 'geo'> = {\n id,\n ip_address,\n email,\n username,\n segment,\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"]}
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
// This method was moved to a new category so we can use `@import Sentry` to use Sentry's Swift
|
|
18
18
|
// classes
|
|
19
|
-
@implementation
|
|
20
|
-
RNSentry (fetchNativeStack)
|
|
19
|
+
@implementation RNSentry (fetchNativeStack)
|
|
21
20
|
|
|
22
21
|
- (NSDictionary *)fetchNativeStackFramesBy:(NSArray<NSNumber *> *)instructionsAddr
|
|
23
22
|
symbolicate:(SymbolicateCallbackType)symbolicate
|
package/ios/RNSentry.h
CHANGED
|
@@ -28,8 +28,7 @@ typedef int (*SymbolicateCallbackType)(const void *, Dl_info *);
|
|
|
28
28
|
|
|
29
29
|
@end
|
|
30
30
|
|
|
31
|
-
@interface
|
|
32
|
-
RNSentry (fetchNativeStack)
|
|
31
|
+
@interface RNSentry (fetchNativeStack)
|
|
33
32
|
|
|
34
33
|
- (NSDictionary *_Nonnull)fetchNativeStackFramesBy:(NSArray<NSNumber *> *)instructionsAddr
|
|
35
34
|
symbolicate:(SymbolicateCallbackType)symbolicate;
|
package/ios/RNSentry.mm
CHANGED
|
@@ -87,10 +87,8 @@ static bool hasFetchedAppStart;
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
RCT_EXPORT_MODULE()
|
|
90
|
-
RCT_EXPORT_METHOD(initNativeSdk
|
|
91
|
-
|
|
92
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
93
|
-
: (RCTPromiseRejectBlock)reject)
|
|
90
|
+
RCT_EXPORT_METHOD(initNativeSdk : (NSDictionary *_Nonnull)options resolve : (
|
|
91
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
94
92
|
{
|
|
95
93
|
NSError *error = nil;
|
|
96
94
|
SentryOptions *sentryOptions = [self createOptionsWithDictionary:options error:&error];
|
|
@@ -200,8 +198,7 @@ RCT_EXPORT_METHOD(initNativeSdk
|
|
|
200
198
|
- (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull)options
|
|
201
199
|
error:(NSError *_Nonnull *_Nonnull)errorPointer
|
|
202
200
|
{
|
|
203
|
-
SentryBeforeSendEventCallback beforeSend = ^SentryEvent *(SentryEvent *event)
|
|
204
|
-
{
|
|
201
|
+
SentryBeforeSendEventCallback beforeSend = ^SentryEvent *(SentryEvent *event) {
|
|
205
202
|
// We don't want to send an event after startup that came from a Unhandled JS Exception of
|
|
206
203
|
// React Native because we sent it already before the app crashed.
|
|
207
204
|
if (nil != event.exceptions.firstObject.type &&
|
|
@@ -288,6 +285,13 @@ RCT_EXPORT_METHOD(initNativeSdk
|
|
|
288
285
|
}
|
|
289
286
|
}
|
|
290
287
|
|
|
288
|
+
if ([mutableOptions valueForKey:@"enableLogs"] != nil) {
|
|
289
|
+
id enableLogsValue = [mutableOptions valueForKey:@"enableLogs"];
|
|
290
|
+
if ([enableLogsValue isKindOfClass:[NSNumber class]]) {
|
|
291
|
+
[RNSentryExperimentalOptions setEnableLogs:[enableLogsValue boolValue]
|
|
292
|
+
sentryOptions:sentryOptions];
|
|
293
|
+
}
|
|
294
|
+
}
|
|
291
295
|
[self trySetIgnoreErrors:mutableOptions];
|
|
292
296
|
|
|
293
297
|
// Enable the App start and Frames tracking measurements
|
|
@@ -355,9 +359,8 @@ RCT_EXPORT_METHOD(initNativeSdk
|
|
|
355
359
|
event.tags = newTags;
|
|
356
360
|
}
|
|
357
361
|
|
|
358
|
-
RCT_EXPORT_METHOD(initNativeReactNavigationNewFrameTracking
|
|
359
|
-
|
|
360
|
-
: (RCTPromiseRejectBlock)reject)
|
|
362
|
+
RCT_EXPORT_METHOD(initNativeReactNavigationNewFrameTracking : (
|
|
363
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
361
364
|
{
|
|
362
365
|
#if SENTRY_HAS_UIKIT
|
|
363
366
|
if ([[NSThread currentThread] isMainThread]) {
|
|
@@ -399,9 +402,8 @@ RCT_EXPORT_METHOD(initNativeReactNavigationNewFrameTracking
|
|
|
399
402
|
return @[ RNSentryNewFrameEvent ];
|
|
400
403
|
}
|
|
401
404
|
|
|
402
|
-
RCT_EXPORT_METHOD(
|
|
403
|
-
|
|
404
|
-
: (RCTPromiseRejectBlock)reject)
|
|
405
|
+
RCT_EXPORT_METHOD(
|
|
406
|
+
fetchNativeSdkInfo : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
405
407
|
{
|
|
406
408
|
resolve(@ {
|
|
407
409
|
@"name" : PrivateSentrySDKOnly.getSdkName,
|
|
@@ -409,9 +411,8 @@ RCT_EXPORT_METHOD(fetchNativeSdkInfo
|
|
|
409
411
|
});
|
|
410
412
|
}
|
|
411
413
|
|
|
412
|
-
RCT_EXPORT_METHOD(
|
|
413
|
-
|
|
414
|
-
: (RCTPromiseRejectBlock)reject)
|
|
414
|
+
RCT_EXPORT_METHOD(
|
|
415
|
+
fetchModules : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
415
416
|
{
|
|
416
417
|
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"modules" ofType:@"json"];
|
|
417
418
|
NSString *modulesString = [NSString stringWithContentsOfFile:filePath
|
|
@@ -426,15 +427,14 @@ RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSString *, fetchNativePackageName)
|
|
|
426
427
|
return packageName;
|
|
427
428
|
}
|
|
428
429
|
|
|
429
|
-
RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(
|
|
430
|
-
|
|
430
|
+
RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(
|
|
431
|
+
NSDictionary *, fetchNativeStackFramesBy : (NSArray *)instructionsAddr)
|
|
431
432
|
{
|
|
432
433
|
return [self fetchNativeStackFramesBy:instructionsAddr symbolicate:dladdr];
|
|
433
434
|
}
|
|
434
435
|
|
|
435
|
-
RCT_EXPORT_METHOD(fetchNativeLogAttributes
|
|
436
|
-
|
|
437
|
-
: (RCTPromiseRejectBlock)reject)
|
|
436
|
+
RCT_EXPORT_METHOD(fetchNativeLogAttributes : (RCTPromiseResolveBlock)resolve rejecter : (
|
|
437
|
+
RCTPromiseRejectBlock)reject)
|
|
438
438
|
{
|
|
439
439
|
__block NSMutableDictionary<NSString *, id> *result = [NSMutableDictionary new];
|
|
440
440
|
|
|
@@ -484,9 +484,8 @@ RCT_EXPORT_METHOD(fetchNativeLogAttributes
|
|
|
484
484
|
resolve(result);
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
-
RCT_EXPORT_METHOD(fetchNativeDeviceContexts
|
|
488
|
-
|
|
489
|
-
: (RCTPromiseRejectBlock)reject)
|
|
487
|
+
RCT_EXPORT_METHOD(fetchNativeDeviceContexts : (RCTPromiseResolveBlock)resolve rejecter : (
|
|
488
|
+
RCTPromiseRejectBlock)reject)
|
|
490
489
|
{
|
|
491
490
|
if (PrivateSentrySDKOnly.options.debug) {
|
|
492
491
|
NSLog(@"Bridge call to: deviceContexts");
|
|
@@ -546,9 +545,8 @@ RCT_EXPORT_METHOD(fetchNativeDeviceContexts
|
|
|
546
545
|
resolve(serializedScope);
|
|
547
546
|
}
|
|
548
547
|
|
|
549
|
-
RCT_EXPORT_METHOD(
|
|
550
|
-
|
|
551
|
-
: (RCTPromiseRejectBlock)reject)
|
|
548
|
+
RCT_EXPORT_METHOD(
|
|
549
|
+
fetchNativeAppStart : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
552
550
|
{
|
|
553
551
|
#if SENTRY_HAS_UIKIT
|
|
554
552
|
NSDictionary<NSString *, id> *measurements =
|
|
@@ -573,9 +571,8 @@ RCT_EXPORT_METHOD(fetchNativeAppStart
|
|
|
573
571
|
#endif
|
|
574
572
|
}
|
|
575
573
|
|
|
576
|
-
RCT_EXPORT_METHOD(
|
|
577
|
-
|
|
578
|
-
: (RCTPromiseRejectBlock)reject)
|
|
574
|
+
RCT_EXPORT_METHOD(
|
|
575
|
+
fetchNativeFrames : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
579
576
|
{
|
|
580
577
|
|
|
581
578
|
#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
|
|
@@ -604,9 +601,8 @@ RCT_EXPORT_METHOD(fetchNativeFrames
|
|
|
604
601
|
#endif
|
|
605
602
|
}
|
|
606
603
|
|
|
607
|
-
RCT_EXPORT_METHOD(
|
|
608
|
-
|
|
609
|
-
: (RCTPromiseRejectBlock)reject)
|
|
604
|
+
RCT_EXPORT_METHOD(
|
|
605
|
+
fetchNativeRelease : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
610
606
|
{
|
|
611
607
|
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
|
|
612
608
|
resolve(@ {
|
|
@@ -616,11 +612,8 @@ RCT_EXPORT_METHOD(fetchNativeRelease
|
|
|
616
612
|
});
|
|
617
613
|
}
|
|
618
614
|
|
|
619
|
-
RCT_EXPORT_METHOD(captureEnvelope
|
|
620
|
-
|
|
621
|
-
: (NSDictionary *_Nonnull)options resolve
|
|
622
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
623
|
-
: (RCTPromiseRejectBlock)reject)
|
|
615
|
+
RCT_EXPORT_METHOD(captureEnvelope : (NSString *_Nonnull)rawBytes options : (NSDictionary *_Nonnull)
|
|
616
|
+
options resolve : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
624
617
|
{
|
|
625
618
|
NSData *data = [[NSData alloc] initWithBase64EncodedString:rawBytes options:0];
|
|
626
619
|
|
|
@@ -643,9 +636,8 @@ RCT_EXPORT_METHOD(captureEnvelope
|
|
|
643
636
|
resolve(@YES);
|
|
644
637
|
}
|
|
645
638
|
|
|
646
|
-
RCT_EXPORT_METHOD(
|
|
647
|
-
|
|
648
|
-
: (RCTPromiseRejectBlock)reject)
|
|
639
|
+
RCT_EXPORT_METHOD(
|
|
640
|
+
captureScreenshot : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
649
641
|
{
|
|
650
642
|
#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
|
|
651
643
|
NSArray<NSData *> *rawScreenshots = [PrivateSentrySDKOnly captureScreenshots];
|
|
@@ -677,9 +669,8 @@ RCT_EXPORT_METHOD(captureScreenshot
|
|
|
677
669
|
#endif
|
|
678
670
|
}
|
|
679
671
|
|
|
680
|
-
RCT_EXPORT_METHOD(
|
|
681
|
-
|
|
682
|
-
: (RCTPromiseRejectBlock)reject)
|
|
672
|
+
RCT_EXPORT_METHOD(
|
|
673
|
+
fetchViewHierarchy : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
683
674
|
{
|
|
684
675
|
#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
|
|
685
676
|
NSData *rawViewHierarchy = [PrivateSentrySDKOnly captureViewHierarchy];
|
|
@@ -793,9 +784,8 @@ RCT_EXPORT_METHOD(setTag : (NSString *)key value : (NSString *)value)
|
|
|
793
784
|
|
|
794
785
|
RCT_EXPORT_METHOD(crash) { [SentrySDKWrapper crash]; }
|
|
795
786
|
|
|
796
|
-
RCT_EXPORT_METHOD(
|
|
797
|
-
|
|
798
|
-
: (RCTPromiseRejectBlock)reject)
|
|
787
|
+
RCT_EXPORT_METHOD(
|
|
788
|
+
closeNativeSdk : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
799
789
|
{
|
|
800
790
|
[SentrySDKWrapper close];
|
|
801
791
|
resolve(@YES);
|
|
@@ -814,10 +804,8 @@ RCT_EXPORT_METHOD(enableNativeFramesTracking)
|
|
|
814
804
|
// the 'tracesSampleRate' or 'tracesSampler' option.
|
|
815
805
|
}
|
|
816
806
|
|
|
817
|
-
RCT_EXPORT_METHOD(captureReplay
|
|
818
|
-
|
|
819
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
820
|
-
: (RCTPromiseRejectBlock)reject)
|
|
807
|
+
RCT_EXPORT_METHOD(captureReplay : (BOOL)isHardCrash resolver : (
|
|
808
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
821
809
|
{
|
|
822
810
|
#if SENTRY_TARGET_REPLAY_SUPPORTED
|
|
823
811
|
[PrivateSentrySDKOnly captureReplay];
|
|
@@ -827,10 +815,8 @@ RCT_EXPORT_METHOD(captureReplay
|
|
|
827
815
|
#endif
|
|
828
816
|
}
|
|
829
817
|
|
|
830
|
-
RCT_EXPORT_METHOD(getDataFromUri
|
|
831
|
-
|
|
832
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
833
|
-
: (RCTPromiseRejectBlock)reject)
|
|
818
|
+
RCT_EXPORT_METHOD(getDataFromUri : (NSString *_Nonnull)uri resolve : (
|
|
819
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
834
820
|
{
|
|
835
821
|
#if TARGET_OS_IPHONE || TARGET_OS_MACCATALYST
|
|
836
822
|
NSURL *fileURL = [NSURL URLWithString:uri];
|
|
@@ -1013,9 +999,8 @@ RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSDictionary *, stopProfiling)
|
|
|
1013
999
|
#endif
|
|
1014
1000
|
}
|
|
1015
1001
|
|
|
1016
|
-
RCT_EXPORT_METHOD(
|
|
1017
|
-
|
|
1018
|
-
: (RCTPromiseRejectBlock)reject)
|
|
1002
|
+
RCT_EXPORT_METHOD(
|
|
1003
|
+
crashedLastRun : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
1019
1004
|
{
|
|
1020
1005
|
resolve(@([SentrySDKWrapper crashedLastRun]));
|
|
1021
1006
|
}
|
|
@@ -1029,17 +1014,14 @@ RCT_EXPORT_METHOD(crashedLastRun
|
|
|
1029
1014
|
}
|
|
1030
1015
|
#endif
|
|
1031
1016
|
|
|
1032
|
-
RCT_EXPORT_METHOD(getNewScreenTimeToDisplay
|
|
1033
|
-
|
|
1034
|
-
: (RCTPromiseRejectBlock)reject)
|
|
1017
|
+
RCT_EXPORT_METHOD(getNewScreenTimeToDisplay : (RCTPromiseResolveBlock)resolve rejecter : (
|
|
1018
|
+
RCTPromiseRejectBlock)reject)
|
|
1035
1019
|
{
|
|
1036
1020
|
[_timeToDisplay getTimeToDisplay:resolve];
|
|
1037
1021
|
}
|
|
1038
1022
|
|
|
1039
|
-
RCT_EXPORT_METHOD(popTimeToDisplayFor
|
|
1040
|
-
|
|
1041
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
1042
|
-
: (RCTPromiseRejectBlock)reject)
|
|
1023
|
+
RCT_EXPORT_METHOD(popTimeToDisplayFor : (NSString *)key resolver : (
|
|
1024
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
1043
1025
|
{
|
|
1044
1026
|
resolve([RNSentryTimeToDisplay popTimeToDisplayFor:key]);
|
|
1045
1027
|
}
|
|
@@ -1050,10 +1032,8 @@ RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, setActiveSpanId : (NSString *)sp
|
|
|
1050
1032
|
return @YES; // The return ensures that the method is synchronous
|
|
1051
1033
|
}
|
|
1052
1034
|
|
|
1053
|
-
RCT_EXPORT_METHOD(encodeToBase64
|
|
1054
|
-
|
|
1055
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
1056
|
-
: (RCTPromiseRejectBlock)reject)
|
|
1035
|
+
RCT_EXPORT_METHOD(encodeToBase64 : (NSArray *)array resolver : (
|
|
1036
|
+
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)
|
|
1057
1037
|
{
|
|
1058
1038
|
NSUInteger count = array.count;
|
|
1059
1039
|
uint8_t *bytes = (uint8_t *)malloc(count);
|
|
@@ -21,6 +21,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
21
21
|
*/
|
|
22
22
|
+ (BOOL)getEnableUnhandledCPPExceptionsV2:(SentryOptions *)sentryOptions;
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Sets the enableLogs experimental option on SentryOptions
|
|
26
|
+
* @param sentryOptions The SentryOptions instance to configure
|
|
27
|
+
* @param enabled Whether logs from sentry Cocoa should be enabled
|
|
28
|
+
*/
|
|
29
|
+
+ (void)setEnableLogs:(BOOL)enabled sentryOptions:(SentryOptions *)sentryOptions;
|
|
30
|
+
|
|
24
31
|
@end
|
|
25
32
|
|
|
26
33
|
NS_ASSUME_NONNULL_END
|
|
@@ -19,4 +19,12 @@
|
|
|
19
19
|
return sentryOptions.experimental.enableUnhandledCPPExceptionsV2;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
+ (void)setEnableLogs:(BOOL)enabled sentryOptions:(SentryOptions *)sentryOptions
|
|
23
|
+
{
|
|
24
|
+
if (sentryOptions == nil) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
sentryOptions.experimental.enableLogs = enabled;
|
|
28
|
+
}
|
|
29
|
+
|
|
22
30
|
@end
|
package/ios/RNSentryVersion.m
CHANGED
|
@@ -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.
|
|
6
|
+
NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"7.3.0";
|
|
@@ -23,8 +23,7 @@ RCT_EXPORT_MODULE(RNSentryReplayUnmask)
|
|
|
23
23
|
@end
|
|
24
24
|
|
|
25
25
|
# ifdef RCT_NEW_ARCH_ENABLED
|
|
26
|
-
@interface
|
|
27
|
-
RNSentryReplayUnmask () <RCTRNSentryReplayUnmaskViewProtocol>
|
|
26
|
+
@interface RNSentryReplayUnmask () <RCTRNSentryReplayUnmaskViewProtocol>
|
|
28
27
|
@end
|
|
29
28
|
# endif
|
|
30
29
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@sentry/react-native",
|
|
3
3
|
"homepage": "https://github.com/getsentry/sentry-react-native",
|
|
4
4
|
"repository": "https://github.com/getsentry/sentry-react-native",
|
|
5
|
-
"version": "7.
|
|
5
|
+
"version": "7.3.0",
|
|
6
6
|
"description": "Official Sentry SDK for react-native",
|
|
7
7
|
"typings": "dist/js/index.d.ts",
|
|
8
8
|
"types": "dist/js/index.d.ts",
|
|
@@ -69,21 +69,21 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@sentry/babel-plugin-component-annotate": "4.3.0",
|
|
72
|
-
"@sentry/browser": "10.
|
|
73
|
-
"@sentry/cli": "2.
|
|
74
|
-
"@sentry/core": "10.
|
|
75
|
-
"@sentry/react": "10.
|
|
76
|
-
"@sentry/types": "10.
|
|
72
|
+
"@sentry/browser": "10.18.0",
|
|
73
|
+
"@sentry/cli": "2.56.0",
|
|
74
|
+
"@sentry/core": "10.18.0",
|
|
75
|
+
"@sentry/react": "10.18.0",
|
|
76
|
+
"@sentry/types": "10.18.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@babel/core": "^7.25.2",
|
|
80
80
|
"@expo/metro-config": "~0.20.0",
|
|
81
81
|
"@mswjs/interceptors": "^0.25.15",
|
|
82
82
|
"@react-native/babel-preset": "0.77.1",
|
|
83
|
-
"@sentry-internal/eslint-config-sdk": "10.
|
|
84
|
-
"@sentry-internal/eslint-plugin-sdk": "10.
|
|
85
|
-
"@sentry-internal/typescript": "10.
|
|
86
|
-
"@sentry/wizard": "6.
|
|
83
|
+
"@sentry-internal/eslint-config-sdk": "10.18.0",
|
|
84
|
+
"@sentry-internal/eslint-plugin-sdk": "10.18.0",
|
|
85
|
+
"@sentry-internal/typescript": "10.18.0",
|
|
86
|
+
"@sentry/wizard": "6.5.0",
|
|
87
87
|
"@testing-library/react-native": "^12.7.2",
|
|
88
88
|
"@types/jest": "^29.5.13",
|
|
89
89
|
"@types/node": "^20.9.3",
|
|
@@ -9,7 +9,7 @@ export interface SentryAndroidGradlePluginOptions {
|
|
|
9
9
|
includeNativeSources?: boolean;
|
|
10
10
|
includeSourceContext?: boolean;
|
|
11
11
|
}
|
|
12
|
-
export declare const sentryAndroidGradlePluginVersion = "5.
|
|
12
|
+
export declare const sentryAndroidGradlePluginVersion = "5.12.1";
|
|
13
13
|
/**
|
|
14
14
|
* Adds the Sentry Android Gradle Plugin to the project.
|
|
15
15
|
* https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#enable-sentry-agp
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withSentryAndroidGradlePlugin = exports.sentryAndroidGradlePluginVersion = void 0;
|
|
4
4
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
5
|
const utils_1 = require("./utils");
|
|
6
|
-
exports.sentryAndroidGradlePluginVersion = '5.
|
|
6
|
+
exports.sentryAndroidGradlePluginVersion = '5.12.1';
|
|
7
7
|
/**
|
|
8
8
|
* Adds the Sentry Android Gradle Plugin to the project.
|
|
9
9
|
* https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#enable-sentry-agp
|
|
@@ -131,7 +131,7 @@ try {
|
|
|
131
131
|
|
|
132
132
|
const sentryBuildPluginPath = path.join(projectRoot, '.env.sentry-build-plugin');
|
|
133
133
|
if (fs.existsSync(sentryBuildPluginPath)) {
|
|
134
|
-
loadDotenv();
|
|
134
|
+
loadDotenv(sentryBuildPluginPath);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
let sentryOrg = getEnvVar(SENTRY_ORG);
|
package/scripts/sentry-xcode.sh
CHANGED
|
@@ -39,7 +39,8 @@ if [ -z "$SENTRY_CLI_EXECUTABLE" ]; then
|
|
|
39
39
|
fi
|
|
40
40
|
[ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_EXECUTABLE="$SENTRY_CLI_PACKAGE_PATH"
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
REACT_NATIVE_XCODE_DEFAULT="../node_modules/react-native/scripts/react-native-xcode.sh"
|
|
43
|
+
REACT_NATIVE_XCODE="${1:-$REACT_NATIVE_XCODE_DEFAULT}"
|
|
43
44
|
|
|
44
45
|
[[ "$AUTO_RELEASE" == false ]] && [[ -z "$BUNDLE_COMMAND" || "$BUNDLE_COMMAND" != "ram-bundle" ]] && NO_AUTO_RELEASE="--no-auto-release"
|
|
45
46
|
ARGS="$NO_AUTO_RELEASE $SENTRY_CLI_EXTRA_ARGS $SENTRY_CLI_RN_XCODE_EXTRA_ARGS"
|