From f8f389c850db7d83754eccced34acb88db441f1e Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 3 Sep 2017 11:21:42 +0200 Subject: [PATCH] Fix ack requests removing pending requests when they shouldn't --- telethon/network/mtproto_sender.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/telethon/network/mtproto_sender.py b/telethon/network/mtproto_sender.py index 46236186..c849cda9 100644 --- a/telethon/network/mtproto_sender.py +++ b/telethon/network/mtproto_sender.py @@ -204,13 +204,13 @@ class MtProtoSender: # msgs_ack, it may handle the request we wanted if code == 0x62d6b459: ack = reader.tgread_object() - for msg_id in ack.msg_ids: - r = self._pop_request(msg_id) - if r: + for r in self._pending_receive: + if r.request_msg_id in ack.msg_ids: self._logger.debug('Ack found for the a request') if self.logging_out: self._logger.debug('Message ack confirmed a request') + self._pending_receive.remove(r) r.confirm_received.set() return True