From a76269ddaf09958590fccdeb416b6ade69801f06 Mon Sep 17 00:00:00 2001 From: Anton Kovalevich Date: Mon, 12 Dec 2022 20:53:09 +0000 Subject: [PATCH] Handle all given updates, avoid short circuit (#1162) --- pyrogram/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyrogram/client.py b/pyrogram/client.py index 67f059e96b..b88ea6918c 100644 --- a/pyrogram/client.py +++ b/pyrogram/client.py @@ -485,7 +485,10 @@ async def fetch_peers(self, peers: List[Union[raw.types.User, raw.types.Chat, ra async def handle_updates(self, updates): if isinstance(updates, (raw.types.Updates, raw.types.UpdatesCombined)): - is_min = (await self.fetch_peers(updates.users)) or (await self.fetch_peers(updates.chats)) + is_min = any(( + await self.fetch_peers(updates.users), + await self.fetch_peers(updates.chats), + )) users = {u.id: u for u in updates.users} chats = {c.id: c for c in updates.chats}