From 38521558a1b55c7201462f1c3f09ee45286eca7b Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 27 Jun 2021 23:18:01 +0600 Subject: [PATCH 1/2] start 0.5.15 --- CHANGELOG.md | 2 ++ gradle.properties | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ddad728a9..cb819502ba7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.5.15 + ## 0.5.14 * `Versions` 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 From 2b7e9534f3ea695c8b194a8d01bb7fea13198fe5 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 28 Jun 2021 00:31:46 +0600 Subject: [PATCH 2/2] hotfix --- CHANGELOG.md | 7 +++++-- .../inmo/micro_utils/coroutines/FlowSubscriptionAsync.kt | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb819502ba7..e90a7e97b92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ # Changelog -## 0.5.15 +## 0.5.15 HOTFIX FOR 0.5.14 -## 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 }