From 948180157f051c7a7f13d65a27125ef263475ab5 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 7 Nov 2025 17:33:09 -0500 Subject: [PATCH] pushes exception upward if triggered --- .../amethyst/service/notifications/PushNotificationUtils.kt | 2 ++ .../api/background/utils/ContentResolverExt.kt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/amethyst/src/play/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt b/amethyst/src/play/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt index 478da0243..10a0be4a8 100644 --- a/amethyst/src/play/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt +++ b/amethyst/src/play/java/com/vitorpamplona/amethyst/service/notifications/PushNotificationUtils.kt @@ -27,6 +27,7 @@ import com.vitorpamplona.quartz.utils.Log import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.tasks.await import okhttp3.OkHttpClient +import kotlin.coroutines.cancellation.CancellationException object PushNotificationUtils { var lastToken: String? = null @@ -44,6 +45,7 @@ object PushNotificationUtils { registerToken(token, accounts, okHttpClient) } catch (e: Exception) { + if (e is CancellationException) throw e Log.e("PushNotificationUtils", "Failed to get Firebase token", e) } } diff --git a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/background/utils/ContentResolverExt.kt b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/background/utils/ContentResolverExt.kt index ccb95a789..5072d3ec1 100644 --- a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/background/utils/ContentResolverExt.kt +++ b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip55AndroidSigner/api/background/utils/ContentResolverExt.kt @@ -26,6 +26,7 @@ import android.net.Uri import com.vitorpamplona.quartz.nip55AndroidSigner.api.IResult import com.vitorpamplona.quartz.nip55AndroidSigner.api.SignerResult import com.vitorpamplona.quartz.utils.Log +import kotlinx.coroutines.CancellationException fun ContentResolver.query( uri: Uri, @@ -51,6 +52,7 @@ fun ContentResolver.query( } } } catch (e: Exception) { + if (e is CancellationException) throw e Log.e("ExternalSignerLauncher", "Failed to query the Signer app in the background", e) SignerResult.RequestIncomplete.ErrorExceptionCallingContentResolver(e) }