From c652d8ff24199245539ba754305e020678a60073 Mon Sep 17 00:00:00 2001 From: GitHub Date: Fri, 27 Jan 2023 03:03:03 +0000 Subject: [PATCH 1/3] chore: update scripts/update-android.sh to 6.13.0 --- CHANGELOG.md | 8 ++++++++ android/build.gradle | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc8fa8c69f..8ac127122c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## Unreleased + +### Dependencies + +- Bump Android SDK from v6.12.1 to v6.13.0 ([#2790](https://github.com/getsentry/sentry-react-native/pull/2790)) + - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6130) + - [diff](https://github.com/getsentry/sentry-java/compare/6.12.1...6.13.0) + ## 4.14.0 ### Features diff --git a/android/build.gradle b/android/build.gradle index 0066e1b751..abf52e6b8f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -24,5 +24,5 @@ android { dependencies { implementation 'com.facebook.react:react-native:+' - api 'io.sentry:sentry-android:6.12.1' + api 'io.sentry:sentry-android:6.13.0' } From 1af37028936723f2c9df03ef419b772872a02769 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Mon, 30 Jan 2023 13:54:33 +0100 Subject: [PATCH 2/3] Fix app start time nanoTimestamp change --- android/src/main/java/io/sentry/react/RNSentryModule.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/android/src/main/java/io/sentry/react/RNSentryModule.java b/android/src/main/java/io/sentry/react/RNSentryModule.java index 7ef0127115..59b4d1e9d2 100644 --- a/android/src/main/java/io/sentry/react/RNSentryModule.java +++ b/android/src/main/java/io/sentry/react/RNSentryModule.java @@ -32,7 +32,6 @@ import java.io.FileOutputStream; import java.io.InputStream; import java.nio.charset.Charset; -import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -45,6 +44,7 @@ import io.sentry.ILogger; import io.sentry.Integration; import io.sentry.Sentry; +import io.sentry.SentryDate; import io.sentry.SentryEvent; import io.sentry.SentryLevel; import io.sentry.UncaughtExceptionHandlerIntegration; @@ -234,7 +234,7 @@ public void fetchNativeRelease(Promise promise) { @ReactMethod public void fetchNativeAppStart(Promise promise) { final AppStartState appStartInstance = AppStartState.getInstance(); - final Date appStartTime = appStartInstance.getAppStartTime(); + final SentryDate appStartTime = appStartInstance.getAppStartTime(); final Boolean isColdStart = appStartInstance.isColdStart(); if (appStartTime == null) { @@ -244,11 +244,11 @@ public void fetchNativeAppStart(Promise promise) { logger.log(SentryLevel.WARNING, "App start won't be sent due to missing isColdStart."); promise.resolve(null); } else { - final double appStartTimestamp = (double) appStartTime.getTime(); + final double appStartTimestampMs = appStartTime.nanoTimestamp() / 1e6; WritableMap appStart = Arguments.createMap(); - appStart.putDouble("appStartTime", appStartTimestamp); + appStart.putDouble("appStartTime", appStartTimestampMs); appStart.putBoolean("isColdStart", isColdStart); appStart.putBoolean("didFetchAppStart", didFetchAppStart); From 9483dec218171af9c5bb34d8fde3801fb30f92e7 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Mon, 30 Jan 2023 14:05:59 +0100 Subject: [PATCH 3/3] Use date utils for conversion nano to millis --- android/src/main/java/io/sentry/react/RNSentryModule.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/io/sentry/react/RNSentryModule.java b/android/src/main/java/io/sentry/react/RNSentryModule.java index 59b4d1e9d2..168d857942 100644 --- a/android/src/main/java/io/sentry/react/RNSentryModule.java +++ b/android/src/main/java/io/sentry/react/RNSentryModule.java @@ -40,6 +40,7 @@ import java.util.concurrent.TimeUnit; import io.sentry.Breadcrumb; +import io.sentry.DateUtils; import io.sentry.HubAdapter; import io.sentry.ILogger; import io.sentry.Integration; @@ -244,7 +245,7 @@ public void fetchNativeAppStart(Promise promise) { logger.log(SentryLevel.WARNING, "App start won't be sent due to missing isColdStart."); promise.resolve(null); } else { - final double appStartTimestampMs = appStartTime.nanoTimestamp() / 1e6; + final double appStartTimestampMs = DateUtils.nanosToMillis(appStartTime.nanoTimestamp()); WritableMap appStart = Arguments.createMap();