@sentry/react-native 5.33.2 → 5.34.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/CHANGELOG.md +20 -0
- package/README.md +8 -0
- package/RNSentry.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +15 -7
- package/dist/js/integrations/nativelinkederrors.js +7 -2
- package/dist/js/integrations/nativelinkederrors.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/package.json +2 -2
- package/sentry.gradle +3 -6
- package/ts3.8/dist/js/version.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.34.0
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- Handles error with string cause ([#4163](https://github.com/getsentry/sentry-react-native/pull/4163))
|
|
8
|
+
- Use `appLaunchedInForeground` to determine invalid app start data on Android ([#4146](https://github.com/getsentry/sentry-react-native/pull/4146))
|
|
9
|
+
- Upload source maps for all release variants on Android (not only the last found) ([#4125](https://github.com/getsentry/sentry-react-native/pull/4125))
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
- Bump CLI from v2.36.6 to v2.37.0 ([#4153](https://github.com/getsentry/sentry-react-native/pull/4153))
|
|
14
|
+
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2370)
|
|
15
|
+
- [diff](https://github.com/getsentry/sentry-cli/compare/2.36.6...2.37.0)
|
|
16
|
+
- Bump Cocoa SDK from v8.36.0 to v8.37.0 ([#4156](https://github.com/getsentry/sentry-react-native/pull/4156))
|
|
17
|
+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8370)
|
|
18
|
+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.36.0...8.37.0)
|
|
19
|
+
- Bump Android SDK from v7.14.0 to v7.15.0 ([#4161](https://github.com/getsentry/sentry-react-native/pull/4161))
|
|
20
|
+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7150)
|
|
21
|
+
- [diff](https://github.com/getsentry/sentry-java/compare/7.14.0...7.15.0)
|
|
22
|
+
|
|
3
23
|
## 5.33.2
|
|
4
24
|
|
|
5
25
|
### Fixes
|
package/README.md
CHANGED
|
@@ -19,6 +19,14 @@ _Bad software is everywhere, and we're tired of it. Sentry is on a mission to he
|
|
|
19
19
|
[](https://discord.gg/PXa5Apfe7K)
|
|
20
20
|
[](https://expo.dev/)
|
|
21
21
|
|
|
22
|
+
## Releases
|
|
23
|
+
|
|
24
|
+
This repo uses the following ways to release SDK updates:
|
|
25
|
+
|
|
26
|
+
- `Pre-release`: We create pre-releases (alpha, beta, RC,…) for larger and potentially more impactful changes, such as new features or major versions.
|
|
27
|
+
- `Latest`: We continuously release major/minor/hotfix versions from the `main` branch. These releases go through all our internal quality gates and are very safe to use and intended to be the default for most teams.
|
|
28
|
+
- `Stable`: We promote releases from `Latest` when they have been used in the field for some time and in scale, considering time since release, adoption, and other quality and stability metrics. These releases will be indicated on [the releases page](https://github.com/getsentry/sentry-react-native/releases/) with the `Stable` suffix.
|
|
29
|
+
|
|
22
30
|
## Requirements
|
|
23
31
|
|
|
24
32
|
- `react-native >= 0.65.0`
|
package/RNSentry.podspec
CHANGED
|
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
|
|
|
37
37
|
|
|
38
38
|
s.compiler_flags = other_cflags
|
|
39
39
|
|
|
40
|
-
s.dependency 'Sentry/HybridSDK', '8.
|
|
40
|
+
s.dependency 'Sentry/HybridSDK', '8.37.0'
|
|
41
41
|
|
|
42
42
|
if defined? install_modules_dependencies
|
|
43
43
|
# Default React Native dependencies for 0.71 and above (new and legacy architecture)
|
package/android/build.gradle
CHANGED
|
@@ -304,7 +304,7 @@ public class RNSentryModuleImpl {
|
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
private SentryReplayOptions getReplayOptions(@NotNull ReadableMap rnOptions) {
|
|
307
|
-
@NotNull final SentryReplayOptions androidReplayOptions = new SentryReplayOptions();
|
|
307
|
+
@NotNull final SentryReplayOptions androidReplayOptions = new SentryReplayOptions(false);
|
|
308
308
|
|
|
309
309
|
@Nullable final ReadableMap rnExperimentsOptions = rnOptions.getMap("_experiments");
|
|
310
310
|
if (rnExperimentsOptions == null) {
|
|
@@ -317,7 +317,7 @@ public class RNSentryModuleImpl {
|
|
|
317
317
|
|
|
318
318
|
androidReplayOptions.setSessionSampleRate(rnExperimentsOptions.hasKey("replaysSessionSampleRate")
|
|
319
319
|
? rnExperimentsOptions.getDouble("replaysSessionSampleRate") : null);
|
|
320
|
-
androidReplayOptions.
|
|
320
|
+
androidReplayOptions.setOnErrorSampleRate(rnExperimentsOptions.hasKey("replaysOnErrorSampleRate")
|
|
321
321
|
? rnExperimentsOptions.getDouble("replaysOnErrorSampleRate") : null);
|
|
322
322
|
|
|
323
323
|
if (!rnOptions.hasKey("mobileReplayOptions")) {
|
|
@@ -328,12 +328,12 @@ public class RNSentryModuleImpl {
|
|
|
328
328
|
return androidReplayOptions;
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
androidReplayOptions.
|
|
332
|
-
androidReplayOptions.
|
|
331
|
+
androidReplayOptions.setMaskAllText(!rnMobileReplayOptions.hasKey("maskAllText") || rnMobileReplayOptions.getBoolean("maskAllText"));
|
|
332
|
+
androidReplayOptions.setMaskAllImages(!rnMobileReplayOptions.hasKey("maskAllImages") || rnMobileReplayOptions.getBoolean("maskAllImages"));
|
|
333
333
|
|
|
334
334
|
final boolean redactVectors = !rnMobileReplayOptions.hasKey("maskAllVectors") || rnMobileReplayOptions.getBoolean("maskAllVectors");
|
|
335
335
|
if (redactVectors) {
|
|
336
|
-
androidReplayOptions.
|
|
336
|
+
androidReplayOptions.addMaskViewClass("com.horcrux.svg.SvgView"); // react-native-svg
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
return androidReplayOptions;
|
|
@@ -380,9 +380,17 @@ public class RNSentryModuleImpl {
|
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
public void fetchNativeAppStart(Promise promise) {
|
|
383
|
-
|
|
383
|
+
fetchNativeAppStart(promise, InternalSentrySdk.getAppStartMeasurement(), logger, AppStartMetrics.getInstance().isAppLaunchedInForeground());
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
protected void fetchNativeAppStart(Promise promise, final Map<String, Object> appStartMeasurement, ILogger logger, boolean isAppLaunchedInForeground) {
|
|
387
|
+
if (!isAppLaunchedInForeground) {
|
|
388
|
+
logger.log(SentryLevel.WARNING, "Invalid app start data: app not launched in foreground.");
|
|
389
|
+
promise.resolve(null);
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
384
392
|
|
|
385
|
-
WritableMap mutableMeasurement = (WritableMap) RNSentryMapConverter.convertToWritable(
|
|
393
|
+
WritableMap mutableMeasurement = (WritableMap) RNSentryMapConverter.convertToWritable(appStartMeasurement);
|
|
386
394
|
mutableMeasurement.putBoolean("has_fetched", hasFetchedAppStart);
|
|
387
395
|
|
|
388
396
|
// This is always set to true, as we would only allow an app start fetch to only
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { exceptionFromError } from '@sentry/browser';
|
|
2
2
|
import { convertIntegrationFnToClass } from '@sentry/core';
|
|
3
|
-
import { isInstanceOf, isPlainObject } from '@sentry/utils';
|
|
3
|
+
import { isInstanceOf, isPlainObject, isString } from '@sentry/utils';
|
|
4
4
|
import { NATIVE } from '../wrapper';
|
|
5
5
|
const INTEGRATION_NAME = 'NativeLinkedErrors';
|
|
6
6
|
const DEFAULT_KEY = 'cause';
|
|
@@ -51,7 +51,12 @@ function walkErrorTree(parser, limit, error, key, exceptions = [], debugImages =
|
|
|
51
51
|
}
|
|
52
52
|
let exception;
|
|
53
53
|
let exceptionDebugImages;
|
|
54
|
-
if (
|
|
54
|
+
if (isString(linkedError)) {
|
|
55
|
+
exception = {
|
|
56
|
+
value: linkedError,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
else if ('stackElements' in linkedError) {
|
|
55
60
|
// isJavaException
|
|
56
61
|
exception = exceptionFromJavaStackElements(linkedError);
|
|
57
62
|
}
|
|
@@ -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;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAc3D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG5D,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,EAAuB,EAAE;IAC/G,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;;;;GAIG;AACH,mDAAmD;AACnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,2BAA2B,CAC3D,gBAAgB,EAChB,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AAwB,CAAC,gBAAgB,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import { exceptionFromError } from '@sentry/browser';\nimport { convertIntegrationFnToClass } from '@sentry/core';\nimport type {\n Client,\n DebugImage,\n Event,\n EventHint,\n Exception,\n ExtendedError,\n Integration,\n IntegrationClass,\n IntegrationFnResult,\n StackFrame,\n StackParser,\n} from '@sentry/types';\nimport { isInstanceOf, isPlainObject } from '@sentry/utils';\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> = {}): IntegrationFnResult => {\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\n/**\n * Processes JS and RN native linked errors.\n *\n * @deprecated Use `nativeLinkedErrorsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const NativeLinkedErrors = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n nativeLinkedErrorsIntegration,\n) as IntegrationClass<Integration> & {\n new (options?: Partial<LinkedErrorsOptions>): Integration;\n};\n\nfunction preprocessEvent(event: Event, hint: EventHint | undefined, client: Client, limit: number, key: string): void {\n if (!event.exception || !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 ('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 && nativeStackFrames.frames.reverse()) || [],\n },\n },\n appleDebugImages: (nativeStackFrames && (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
|
+
{"version":3,"file":"nativelinkederrors.js","sourceRoot":"","sources":["../../../src/js/integrations/nativelinkederrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAc3D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGtE,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,EAAuB,EAAE;IAC/G,MAAM,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AE;YACd,IAAI,EAAE,aAAa,CAAC,IAAI;YACxB,KAAK,EAAE,aAAa,CAAC,OAAO;YAC5B,UAAU,EAAE;gBACV,MAAM,EAAE,CAAC,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE;aACxE;SACF;QACD,gBAAgB,EAAE,CAAC,iBAAiB,IAAK,iBAAiB,CAAC,eAAgC,CAAC,IAAI,EAAE;KACnG,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 { convertIntegrationFnToClass } from '@sentry/core';\nimport type {\n Client,\n DebugImage,\n Event,\n EventHint,\n Exception,\n ExtendedError,\n Integration,\n IntegrationClass,\n IntegrationFnResult,\n StackFrame,\n StackParser,\n} from '@sentry/types';\nimport { isInstanceOf, isPlainObject, isString } from '@sentry/utils';\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> = {}): IntegrationFnResult => {\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\n/**\n * Processes JS and RN native linked errors.\n *\n * @deprecated Use `nativeLinkedErrorsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const NativeLinkedErrors = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n nativeLinkedErrorsIntegration,\n) as IntegrationClass<Integration> & {\n new (options?: Partial<LinkedErrorsOptions>): Integration;\n};\n\nfunction preprocessEvent(event: Event, hint: EventHint | undefined, client: Client, limit: number, key: string): void {\n if (!event.exception || !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 && nativeStackFrames.frames.reverse()) || [],\n },\n },\n appleDebugImages: (nativeStackFrames && (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"]}
|
package/dist/js/version.d.ts
CHANGED
package/dist/js/version.js
CHANGED
package/dist/js/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/js/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native';\nexport const SDK_NAME = 'sentry.javascript.react-native';\nexport const SDK_VERSION = '5.34.0';\n"]}
|
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": "5.
|
|
5
|
+
"version": "5.34.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,7 +69,7 @@
|
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@sentry/babel-plugin-component-annotate": "2.20.1",
|
|
71
71
|
"@sentry/browser": "7.119.1",
|
|
72
|
-
"@sentry/cli": "2.
|
|
72
|
+
"@sentry/cli": "2.37.0",
|
|
73
73
|
"@sentry/core": "7.119.1",
|
|
74
74
|
"@sentry/hub": "7.119.0",
|
|
75
75
|
"@sentry/integrations": "7.119.0",
|
package/sentry.gradle
CHANGED
|
@@ -65,9 +65,6 @@ gradle.projectsEvaluated {
|
|
|
65
65
|
def currentVariants = extractCurrentVariants(bundleTask, releases)
|
|
66
66
|
if (currentVariants == null) return
|
|
67
67
|
|
|
68
|
-
def variant = null
|
|
69
|
-
def releaseName = null
|
|
70
|
-
def versionCode = null
|
|
71
68
|
def previousCliTask = null
|
|
72
69
|
def applicationVariant = null
|
|
73
70
|
|
|
@@ -75,9 +72,9 @@ gradle.projectsEvaluated {
|
|
|
75
72
|
def nameModulesCleanup = "${bundleTask.name}_SentryCollectModulesCleanUp"
|
|
76
73
|
// Upload the source map several times if necessary: once for each release and versionCode.
|
|
77
74
|
currentVariants.each { key, currentVariant ->
|
|
78
|
-
variant = currentVariant[0]
|
|
79
|
-
releaseName = currentVariant[1]
|
|
80
|
-
versionCode = currentVariant[2]
|
|
75
|
+
def variant = currentVariant[0]
|
|
76
|
+
def releaseName = currentVariant[1]
|
|
77
|
+
def versionCode = currentVariant[2]
|
|
81
78
|
applicationVariant = currentVariant[3]
|
|
82
79
|
|
|
83
80
|
try {
|