1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +00:00

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`: * `Versions`:
* `Kotlin`: `1.8.10` -> `1.8.20` * `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`: * `Core`:
* New `RequestsExecutor` - `MultipleClientKtorRequestsExecutor` * New `RequestsExecutor` - `MultipleClientKtorRequestsExecutor`
* Old `KtorRequestsExecutor` has been renamed to `DefaultKtorRequestsExecutor` * Old `KtorRequestsExecutor` has been renamed to `DefaultKtorRequestsExecutor`

View File

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

View File

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