diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 67246f7e..6851491d 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -1097,11 +1097,6 @@ void UpdatesManager::after_get_difference() { if (postponed_updates_.size()) { VLOG(get_difference) << "Begin to apply " << postponed_updates_.size() << " postponed updates"; while (!postponed_updates_.empty()) { - if (running_get_difference_) { - VLOG(get_difference) << "Finish to apply postponed updates with " << postponed_updates_.size() - << " updates left, because forced to run getDifference"; - return; - } auto it = postponed_updates_.begin(); auto updates = std::move(it->second.updates); auto updates_seq_begin = it->second.seq_begin; @@ -1109,6 +1104,11 @@ void UpdatesManager::after_get_difference() { // ignore it->second.date, because it may be too old postponed_updates_.erase(it); on_pending_updates(std::move(updates), updates_seq_begin, updates_seq_end, 0, "postponed updates"); + if (running_get_difference_) { + VLOG(get_difference) << "Finish to apply postponed updates with " << postponed_updates_.size() + << " updates left, because forced to run getDifference"; + return; + } } VLOG(get_difference) << "Finish to apply postponed updates"; }