fix in updates unique calculation and update dependencies

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

No files matched your search

@@ -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 {