diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ddad728a9..e90a7e97b92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog -## 0.5.14 +## 0.5.15 HOTFIX FOR 0.5.14 + +* `Coroutines` + * Fixes in `subscribeAsync` + +## 0.5.14 NOT RECOMMENDED * `Versions` * `Kotlin`: `1.5.10` -> `1.5.20` diff --git a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/FlowSubscriptionAsync.kt b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/FlowSubscriptionAsync.kt index 0a3019f6009..7bde7300015 100644 --- a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/FlowSubscriptionAsync.kt +++ b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/FlowSubscriptionAsync.kt @@ -38,7 +38,7 @@ private data class AsyncSubscriptionCommandData( override suspend fun invoke(markersMap: MutableMap>) { val marker = markerFactory(data) markersMap.getOrPut(marker) { - SubscribeAsyncReceiver(scope) { + SubscribeAsyncReceiver(scope.LinkedSupervisorScope()) { safelyWithoutExceptions { block(it) } if (isEmpty()) { onEmpty(marker) @@ -80,7 +80,7 @@ fun Flow.subscribeAsync( actor.send(dataCommand) } - job.invokeOnCompletion { subscope.cancel() } + job.invokeOnCompletion { if (subscope.isActive) subscope.cancel() } return job } diff --git a/gradle.properties b/gradle.properties index b9a05f40b22..ed42997a3f3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -45,5 +45,5 @@ dokka_version=1.4.32 # Project data group=dev.inmo -version=0.5.14 -android_code_version=55 +version=0.5.15 +android_code_version=56