1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-04 23:59:55 +00:00

fix in updates unique calculation and update dependencies

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

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 {