From d3381371d9850d6fe37ff1847ef460d8e99d8132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Santos?= Date: Wed, 13 Nov 2024 11:55:21 +0000 Subject: [PATCH 1/2] Update Sentry --- .../ooni/probe/shared/monitoring/CrashMonitoring.kt | 10 +++------- gradle/libs.versions.toml | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/composeApp/src/commonFullMain/kotlin/org/ooni/probe/shared/monitoring/CrashMonitoring.kt b/composeApp/src/commonFullMain/kotlin/org/ooni/probe/shared/monitoring/CrashMonitoring.kt index a8925c36..5fd1802f 100644 --- a/composeApp/src/commonFullMain/kotlin/org/ooni/probe/shared/monitoring/CrashMonitoring.kt +++ b/composeApp/src/commonFullMain/kotlin/org/ooni/probe/shared/monitoring/CrashMonitoring.kt @@ -13,8 +13,6 @@ import org.ooni.probe.data.repositories.PreferenceRepository class CrashMonitoring( private val preferencesRepository: PreferenceRepository, ) { - private var isEnabled = false - suspend fun setup() { preferencesRepository.getValueByKey(SettingsKey.SEND_CRASH) .onEach { sendCrash -> @@ -22,9 +20,7 @@ class CrashMonitoring( Sentry.init { it.dsn = SENTRY_DSN } - isEnabled = true } else { - isEnabled = false Sentry.close() } } @@ -35,7 +31,7 @@ class CrashMonitoring( override fun isLoggable( tag: String, severity: Severity, - ): Boolean = isEnabled && severity != Severity.Verbose + ): Boolean = Sentry.isEnabled() && severity != Severity.Verbose override fun log( severity: Severity, @@ -43,9 +39,9 @@ class CrashMonitoring( tag: String, throwable: Throwable?, ) { - if (!isEnabled) return + if (!Sentry.isEnabled()) return - if (severity == Severity.Error) { + if (severity == Severity.Warn || severity == Severity.Error) { if (throwable != null) { addBreadcrumb(severity, message, tag) Sentry.captureException(throwable) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e9a2a79c..cfa5d0ef 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -66,7 +66,7 @@ kottie = { module = "io.github.alexzhirkevich:compottie", version = "2.0.0-rc01" moko-permissions = { module ="dev.icerock.moko:permissions-compose", version = "0.18.0" } # Crash Reporting -sentry = { module = "io.sentry:sentry-kotlin-multiplatform", version = "0.9.0" } +sentry = { module = "io.sentry:sentry-kotlin-multiplatform", version = "0.10.0" } # Markdown markdown = { module = "com.mikepenz:multiplatform-markdown-renderer-m3", version = "0.26.0" } From 3f52c244879ff7af3fc05ab948e2400a64f0033e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Santos?= Date: Wed, 13 Nov 2024 12:33:07 +0000 Subject: [PATCH 2/2] Fix ios build --- composeApp/build.gradle.kts | 2 +- composeApp/composeApp.podspec | 2 +- iosApp/Podfile.lock | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index 08969c95..2564b71d 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -73,7 +73,7 @@ kotlin { } pod("Sentry") { - version = "~> 8.36.0" + version = "~> 8.38.0" extraOpts += listOf("-compiler-option", "-fmodules") } diff --git a/composeApp/composeApp.podspec b/composeApp/composeApp.podspec index 98f861e1..6714ef04 100644 --- a/composeApp/composeApp.podspec +++ b/composeApp/composeApp.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.vendored_frameworks = 'build/cocoapods/framework/composeApp.framework' spec.libraries = 'c++' spec.ios.deployment_target = '14.0' - spec.dependency 'Sentry', '~> 8.36.0' + spec.dependency 'Sentry', '~> 8.38.0' if !Dir.exist?('build/cocoapods/framework/composeApp.framework') || Dir.empty?('build/cocoapods/framework/composeApp.framework') raise " diff --git a/iosApp/Podfile.lock b/iosApp/Podfile.lock index c2a4c027..74e7870f 100644 --- a/iosApp/Podfile.lock +++ b/iosApp/Podfile.lock @@ -1,15 +1,15 @@ PODS: - composeApp (1.0): - - Sentry (~> 8.36.0) + - Sentry (~> 8.38.0) - libcrypto (2024.05.22-093305) - libevent (2024.05.22-093305) - libssl (2024.05.22-093305) - libtor (2024.05.22-093305) - libz (2024.05.22-093305) - oonimkall (2024.05.22-093305) - - Sentry (8.36.0): - - Sentry/Core (= 8.36.0) - - Sentry/Core (8.36.0) + - Sentry (8.38.0): + - Sentry/Core (= 8.38.0) + - Sentry/Core (8.38.0) - sqlite3 (3.42.0): - sqlite3/common (= 3.42.0) - sqlite3/common (3.42.0) @@ -46,14 +46,14 @@ EXTERNAL SOURCES: :podspec: https://github.com/ooni/probe-cli/releases/download/v3.22.0/oonimkall.podspec SPEC CHECKSUMS: - composeApp: c76b67d627c47a16beae854efd6e005d15cca68e + composeApp: 675ce506dcd05e76ecb4fdd0f73a10d4af635af1 libcrypto: 1bb58600c586e28688f5578f4675f5ffa46c8eaf libevent: 5c8502ca5cc38be31bb510ddade0f238bcc5f0dc libssl: 170bebcaf567a0285e91a8850b9686137d07c3e1 libtor: c72b23da6a5d2e16173149784f11cf66156c35be libz: 83658eb2a0db785623ffdf9ce13407e6b8b5c8f9 oonimkall: 9768ce9dad18265d45d2ea972c84fb0bd5237cc3 - Sentry: f8374b5415bc38dfb5645941b3ae31230fbeae57 + Sentry: 205813e7e758b53df157cedb8c55b31a14300645 sqlite3: f163dbbb7aa3339ad8fc622782c2d9d7b72f7e9c PODFILE CHECKSUM: 7ccceb3a8043e0a52e0aaf77c23a4e93dbe689e7