From 7e0639ac57f129e3675e126d1a4e75106221c749 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 30 May 2022 13:31:29 +0200 Subject: [PATCH] Add getting_diff_for assertion in get_channel_difference too --- telethon/_updates/messagebox.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/telethon/_updates/messagebox.py b/telethon/_updates/messagebox.py index bfa04552..024c067f 100644 --- a/telethon/_updates/messagebox.py +++ b/telethon/_updates/messagebox.py @@ -606,6 +606,7 @@ class MessageBox: packed = chat_hashes.get(entry) if not packed: # Cannot get channel difference as we're missing its hash + # TODO we should probably log this self.end_get_diff(entry) # Remove the outdated `pts` entry from the map so that the next update can correct # it. Otherwise, it will spam that the access hash is missing. @@ -614,10 +615,7 @@ class MessageBox: state = self.map.get(entry) if not state: - # TODO investigate when/why/if this can happen - # Cannot get channel difference as we're missing its pts - self.end_get_diff(entry) - return None + raise RuntimeError('Should not try to get difference for an entry without known state') return fn.updates.GetChannelDifferenceRequest( force=False,