From 494a619bd8891bffe32b95419a8da4810587f3d5 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Fri, 27 Sep 2024 17:55:37 +0300 Subject: [PATCH 1/4] Adds breadcrumb origin in RNSentryBreadcrumb dictionary parsing --- android/src/main/java/io/sentry/react/RNSentryBreadcrumb.java | 4 ++++ ios/RNSentryBreadcrumb.m | 1 + 2 files changed, 5 insertions(+) diff --git a/android/src/main/java/io/sentry/react/RNSentryBreadcrumb.java b/android/src/main/java/io/sentry/react/RNSentryBreadcrumb.java index 3fcfffcf83..2c7db0be0d 100644 --- a/android/src/main/java/io/sentry/react/RNSentryBreadcrumb.java +++ b/android/src/main/java/io/sentry/react/RNSentryBreadcrumb.java @@ -48,6 +48,10 @@ public static Breadcrumb fromMap(ReadableMap from) { breadcrumb.setCategory(from.getString("category")); } + if (from.hasKey("origin")) { + breadcrumb.setOrigin(from.getString("origin")); + } + if (from.hasKey("level")) { switch (from.getString("level")) { case "fatal": diff --git a/ios/RNSentryBreadcrumb.m b/ios/RNSentryBreadcrumb.m index e900ba4833..4d0b094eb6 100644 --- a/ios/RNSentryBreadcrumb.m +++ b/ios/RNSentryBreadcrumb.m @@ -23,6 +23,7 @@ +(SentryBreadcrumb*) from: (NSDictionary *) dict [crumb setLevel:sentryLevel]; [crumb setCategory:dict[@"category"]]; + [crumb setOrigin:dict[@"origin"]]; [crumb setType:dict[@"type"]]; [crumb setMessage:dict[@"message"]]; [crumb setData:dict[@"data"]]; From a636be5ea5ab91f1d1b11ab8c4735403fcdf3d43 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Tue, 8 Oct 2024 13:05:18 +0300 Subject: [PATCH 2/4] Use 8.38.0-beta.1 Cocoa SDK that has the new origin field --- RNSentry.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RNSentry.podspec b/RNSentry.podspec index 5059662f04..beca2ba0cf 100644 --- a/RNSentry.podspec +++ b/RNSentry.podspec @@ -37,7 +37,7 @@ Pod::Spec.new do |s| s.compiler_flags = other_cflags - s.dependency 'Sentry/HybridSDK', '8.36.0' + s.dependency 'Sentry/HybridSDK', '8.38.0-beta.1' if defined? install_modules_dependencies # Default React Native dependencies for 0.71 and above (new and legacy architecture) From 197f863e8547fbac608a7df1689004aea71ba686 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Wed, 9 Oct 2024 17:16:55 +0300 Subject: [PATCH 3/4] Adds changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54033f5b6d..f5221a10a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Fixes +- Adds breadcrumb origin field to prevent exception capture context from being overwritten by native scope sync ([#4124](https://github.com/getsentry/sentry-react-native/pull/4124)) - Use `appLaunchedInForeground` to determine invalid app start data on Android ([#4146](https://github.com/getsentry/sentry-react-native/pull/4146)) - Upload source maps for all release variants on Android (not only the last found) ([#4125](https://github.com/getsentry/sentry-react-native/pull/4125)) From 9bee5c9af25a625061510a7a30b5fff92f0e2a21 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Wed, 9 Oct 2024 17:51:20 +0300 Subject: [PATCH 4/4] Fixes sentry-java breaking changes --- android/src/main/java/io/sentry/react/RNSentryModuleImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java b/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java index cd498308f3..37e36bb4c1 100644 --- a/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +++ b/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java @@ -317,7 +317,7 @@ private SentryReplayOptions getReplayOptions(@NotNull ReadableMap rnOptions) { androidReplayOptions.setSessionSampleRate(rnExperimentsOptions.hasKey("replaysSessionSampleRate") ? rnExperimentsOptions.getDouble("replaysSessionSampleRate") : null); - androidReplayOptions.setErrorSampleRate(rnExperimentsOptions.hasKey("replaysOnErrorSampleRate") + androidReplayOptions.setOnErrorSampleRate(rnExperimentsOptions.hasKey("replaysOnErrorSampleRate") ? rnExperimentsOptions.getDouble("replaysOnErrorSampleRate") : null); if (!rnOptions.hasKey("mobileReplayOptions")) { @@ -333,7 +333,7 @@ private SentryReplayOptions getReplayOptions(@NotNull ReadableMap rnOptions) { final boolean redactVectors = !rnMobileReplayOptions.hasKey("maskAllVectors") || rnMobileReplayOptions.getBoolean("maskAllVectors"); if (redactVectors) { - androidReplayOptions.addClassToRedact("com.horcrux.svg.SvgView"); // react-native-svg + androidReplayOptions.addRedactViewClass("com.horcrux.svg.SvgView"); // react-native-svg } return androidReplayOptions;