diff --git a/composeApp/src/commonMain/kotlin/press/mantra/compose/network/relays/EventPublishTransport.kt b/composeApp/src/commonMain/kotlin/press/mantra/compose/network/relays/EventPublishTransport.kt index a15fd5db..f269f013 100644 --- a/composeApp/src/commonMain/kotlin/press/mantra/compose/network/relays/EventPublishTransport.kt +++ b/composeApp/src/commonMain/kotlin/press/mantra/compose/network/relays/EventPublishTransport.kt @@ -28,5 +28,6 @@ interface EventPublishTransport { * * @see RelayPool.publishEvent */ + @Throws(press.mantra.compose.exceptions.NostrPublishException::class, kotlin.coroutines.cancellation.CancellationException::class) suspend fun publishEvent(nostrEvent: NostrEvent, relays: Set): Flow } diff --git a/composeApp/src/commonMain/kotlin/press/mantra/compose/network/relays/RelayPool.kt b/composeApp/src/commonMain/kotlin/press/mantra/compose/network/relays/RelayPool.kt index a260a1d7..42c3e99f 100644 --- a/composeApp/src/commonMain/kotlin/press/mantra/compose/network/relays/RelayPool.kt +++ b/composeApp/src/commonMain/kotlin/press/mantra/compose/network/relays/RelayPool.kt @@ -286,7 +286,7 @@ class RelayPool( ) } - @Throws(press.mantra.compose.exceptions.NostrPublishException::class) + @Throws(press.mantra.compose.exceptions.NostrPublishException::class, kotlin.coroutines.cancellation.CancellationException::class) suspend fun publishEvent(nostrEvent: press.mantra.compose.database.model.NostrEvent, relays: Set = emptySet()): Flow { val relayUrls = relays.map { NormalizedRelayUrl(it.url).displayUrl() } diff --git a/composeApp/src/commonMain/kotlin/press/mantra/compose/network/relays/RelaysSocketManager.kt b/composeApp/src/commonMain/kotlin/press/mantra/compose/network/relays/RelaysSocketManager.kt index c79e7f7c..81db3293 100644 --- a/composeApp/src/commonMain/kotlin/press/mantra/compose/network/relays/RelaysSocketManager.kt +++ b/composeApp/src/commonMain/kotlin/press/mantra/compose/network/relays/RelaysSocketManager.kt @@ -100,7 +100,7 @@ class RelaysSocketManager( relayPool.closePool() } - @Throws(press.mantra.compose.exceptions.NostrPublishException::class) + @Throws(press.mantra.compose.exceptions.NostrPublishException::class, kotlin.coroutines.cancellation.CancellationException::class) suspend fun publishEvent(nostrEvent: press.mantra.compose.database.model.NostrEvent): Flow { return if (userRelays.isNotEmpty()) { relayPool.publishEvent( @@ -115,7 +115,7 @@ class RelaysSocketManager( } } - @Throws(press.mantra.compose.exceptions.NostrPublishException::class) + @Throws(press.mantra.compose.exceptions.NostrPublishException::class, kotlin.coroutines.cancellation.CancellationException::class) override suspend fun publishEvent(nostrEvent: press.mantra.compose.database.model.NostrEvent, relays: Set): Flow { logger.d("publishEvent: $nostrEvent") return relayPool.publishEvent( diff --git a/composeApp/src/commonMain/kotlin/press/mantra/compose/repository/NostrPublisherRepository.kt b/composeApp/src/commonMain/kotlin/press/mantra/compose/repository/NostrPublisherRepository.kt index ef911ca7..93bc0bfd 100644 --- a/composeApp/src/commonMain/kotlin/press/mantra/compose/repository/NostrPublisherRepository.kt +++ b/composeApp/src/commonMain/kotlin/press/mantra/compose/repository/NostrPublisherRepository.kt @@ -30,7 +30,7 @@ class NostrPublisherRepository( } } - @Throws(press.mantra.compose.exceptions.NostrPublishException::class) + @Throws(press.mantra.compose.exceptions.NostrPublishException::class, kotlin.coroutines.cancellation.CancellationException::class) private suspend fun publishAndImportEvent(signedNostrEvent: press.mantra.compose.database.model.NostrEvent, outboxRelays: List = emptyList()) { relaysSocketManager.publishEvent(signedNostrEvent) importEvent(signedNostrEvent) @@ -52,7 +52,7 @@ class NostrPublisherRepository( } } - @Throws(press.mantra.compose.exceptions.NostrPublishException::class, press.mantra.compose.exceptions.SignatureException::class) + @Throws(press.mantra.compose.exceptions.NostrPublishException::class, press.mantra.compose.exceptions.SignatureException::class, kotlin.coroutines.cancellation.CancellationException::class) suspend fun signPublishImportNostrEvent( unsignedNostrEvent: press.mantra.compose.database.model.UnsignedNostrEvent, outboxRelays: List, @@ -63,7 +63,7 @@ class NostrPublisherRepository( } - @Throws(press.mantra.compose.exceptions.NostrPublishException::class, press.mantra.compose.exceptions.SignatureException::class) + @Throws(press.mantra.compose.exceptions.NostrPublishException::class, press.mantra.compose.exceptions.SignatureException::class, kotlin.coroutines.cancellation.CancellationException::class) suspend fun publishRelayList(userId: String, relays: List): press.mantra.compose.database.model.NostrEvent { val signedNostrEvent = nostrNotary.signRelayListMetadata(userId = userId, relays = relays).unwrapOrThrow() relaysSocketManager.publishEvent(nostrEvent = signedNostrEvent, relays = relays.toSet()) diff --git a/composeApp/src/iosMain/kotlin/press/mantra/compose/Platform.ios.kt b/composeApp/src/iosMain/kotlin/press/mantra/compose/Platform.ios.kt index cfaf67f8..37ba5f43 100644 --- a/composeApp/src/iosMain/kotlin/press/mantra/compose/Platform.ios.kt +++ b/composeApp/src/iosMain/kotlin/press/mantra/compose/Platform.ios.kt @@ -1,7 +1,6 @@ package press.mantra.compose import platform.UIKit.UIDevice -import kotlin.native.Platform class IOSPlatform: Platform { override val name: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion