From 6bbb1f68a5c520774cb8197248d36c90d21ed623 Mon Sep 17 00:00:00 2001 From: lepicekmichal Date: Sun, 16 Jun 2024 23:03:09 +0200 Subject: [PATCH] fix crash --- gradle.properties | 2 +- signalrkore/build.gradle.kts | 1 + .../eu/lepicekmichal/signalrkore/HttpHubConnectionBuilder.kt | 1 + .../kotlin/eu/lepicekmichal/signalrkore/HubConnection.kt | 3 ++- .../signalrkore/transports/LongPollingTransport.kt | 2 ++ 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5c8184f..0c94b7c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ RELEASE_SIGNING_ENABLED=true GROUP=eu.lepicekmichal.signalrkore POM_ARTIFACT_ID=signalrkore -VERSION_NAME=0.8.4 +VERSION_NAME=0.8.5 POM_NAME=SignalR Kore POM_DESCRIPTION=Connect to SignalR Core server with library written in Kotlin and coroutines. diff --git a/signalrkore/build.gradle.kts b/signalrkore/build.gradle.kts index 9067db4..76ec733 100644 --- a/signalrkore/build.gradle.kts +++ b/signalrkore/build.gradle.kts @@ -30,6 +30,7 @@ kotlin { if (OperatingSystem.current().isMacOsX) { listOf( + iosX64(), iosArm64(), iosSimulatorArm64() ).forEach { iosTarget -> diff --git a/signalrkore/src/commonMain/kotlin/eu/lepicekmichal/signalrkore/HttpHubConnectionBuilder.kt b/signalrkore/src/commonMain/kotlin/eu/lepicekmichal/signalrkore/HttpHubConnectionBuilder.kt index 2a26266..9051b41 100644 --- a/signalrkore/src/commonMain/kotlin/eu/lepicekmichal/signalrkore/HttpHubConnectionBuilder.kt +++ b/signalrkore/src/commonMain/kotlin/eu/lepicekmichal/signalrkore/HttpHubConnectionBuilder.kt @@ -73,6 +73,7 @@ class HttpHubConnectionBuilder(private val url: String) { handshakeResponseTimeout, headers.toMap(), transportEnum, + null, json, logger, ) diff --git a/signalrkore/src/commonMain/kotlin/eu/lepicekmichal/signalrkore/HubConnection.kt b/signalrkore/src/commonMain/kotlin/eu/lepicekmichal/signalrkore/HubConnection.kt index 10b6645..97171ff 100644 --- a/signalrkore/src/commonMain/kotlin/eu/lepicekmichal/signalrkore/HubConnection.kt +++ b/signalrkore/src/commonMain/kotlin/eu/lepicekmichal/signalrkore/HubConnection.kt @@ -18,6 +18,7 @@ import io.ktor.utils.io.core.* import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.IO import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.cancelChildren import kotlinx.coroutines.delay @@ -125,7 +126,7 @@ class HubConnection private constructor( } if (skipNegotiate && transportEnum != TransportEnum.WebSockets) - throw RuntimeException("Negotiation can only be skipped when using the WebSocket transport") + throw RuntimeException("Negotiation can only be skipped when using a WebSocket transport") val (negotiationTransport, negotiationUrl) = if (!skipNegotiate) { try { diff --git a/signalrkore/src/commonMain/kotlin/eu/lepicekmichal/signalrkore/transports/LongPollingTransport.kt b/signalrkore/src/commonMain/kotlin/eu/lepicekmichal/signalrkore/transports/LongPollingTransport.kt index b337b7e..50bd884 100644 --- a/signalrkore/src/commonMain/kotlin/eu/lepicekmichal/signalrkore/transports/LongPollingTransport.kt +++ b/signalrkore/src/commonMain/kotlin/eu/lepicekmichal/signalrkore/transports/LongPollingTransport.kt @@ -13,6 +13,7 @@ import io.ktor.http.HttpStatusCode import io.ktor.http.contentLength import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.IO import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.cancel import kotlinx.coroutines.flow.Flow @@ -21,6 +22,7 @@ import kotlinx.coroutines.flow.asSharedFlow import kotlinx.coroutines.isActive import kotlinx.coroutines.launch import kotlinx.datetime.Clock +import kotlin.jvm.Volatile internal class LongPollingTransport(private val headers: Map, private val client: HttpClient) : Transport {