fix in updates unique calculation and update dependencies

This commit is contained in:
InsanusMokrassar 2023-04-19 20:29:40 +06:00
parent 3b2310ece1
commit 241545c0cb
3 changed files with 10 additions and 6 deletions

View File

@ -6,7 +6,8 @@ _This update brings experimental support of `linuxX64` and `mingwX64` platforms_
* `Versions`:
* `Kotlin`: `1.8.10` -> `1.8.20`
* `MicroUtils`: `0.17.5` -> `0.17.6`
* `MicroUtils`: `0.17.5` -> `0.17.8`
* `Ktor`: `2.2.4` -> `2.3.0`
* `Core`:
* New `RequestsExecutor` - `MultipleClientKtorRequestsExecutor`
* Old `KtorRequestsExecutor` has been renamed to `DefaultKtorRequestsExecutor`

View File

@ -8,12 +8,12 @@ javax-activation = "1.1.1"
korlibs = "3.4.0"
uuid = "0.7.0"
ktor = "2.2.4"
ktor = "2.3.0"
ksp = "1.8.20-1.0.11"
kotlin-poet = "1.13.0"
microutils = "0.17.6"
microutils = "0.17.8"
github-release-plugin = "2.4.1"
dokka = "1.8.10"

View File

@ -76,9 +76,12 @@ class DefaultBehaviourContext(
(it + upstreamUpdatesFlow).filter {
val passed = handledUpdates.add(it.updateId)
(passed).also { passed ->
handledUpdates.removeAll(
handledUpdates.take(handledUpdates.size - broadcastChannelsSize).ifEmpty { return@also }
)
val needToDropCount = handledUpdates.size - broadcastChannelsSize
if (needToDropCount > 0) {
handledUpdates.removeAll(
handledUpdates.take(needToDropCount).ifEmpty { return@also }
)
}
}
}
} else {