Skip to content

Commit

Permalink
Merge pull request #266 from ooni/update-sentry
Browse files Browse the repository at this point in the history
Update Sentry
  • Loading branch information
sdsantos authored Nov 13, 2024
2 parents 2d0d69b + 3f52c24 commit 7ec3e87
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ kotlin {
}

pod("Sentry") {
version = "~> 8.36.0"
version = "~> 8.38.0"
extraOpts += listOf("-compiler-option", "-fmodules")
}

Expand Down
2 changes: 1 addition & 1 deletion composeApp/composeApp.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@ 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 ->
if (sendCrash == true) {
Sentry.init {
it.dsn = SENTRY_DSN
}
isEnabled = true
} else {
isEnabled = false
Sentry.close()
}
}
Expand All @@ -35,17 +31,17 @@ 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,
message: String,
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)
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
12 changes: 6 additions & 6 deletions iosApp/Podfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7ec3e87

Please sign in to comment.