fix: create a copy of selected TTL messages

This commit is contained in:
AlexeyZavar 2025-03-08 23:58:27 +03:00
parent 4bce9d440e
commit ce8650b4de

View file

@ -2573,7 +2573,9 @@ void Session::checkTTLs() {
}) | ranges::views::transform([](const auto &pair) {
return pair.second;
}) | ranges::views::join;
for (auto &item : toBeRemoved) {
auto itemsToProcess = toBeRemoved | ranges::to_vector;
for (const auto &item : itemsToProcess) {
// remove message from `_ttlMessages` to avoid calling this method infinitely
item->applyTTL(0);