Handle TypeNotFoundError during gzip packed msgs

This commit is contained in:
Lonami Exo 2022-01-23 13:26:53 +01:00
parent f1a517dee6
commit 015acf20c6

View File

@ -625,7 +625,15 @@ class MTProtoSender:
""" """
self._log.debug('Handling gzipped data') self._log.debug('Handling gzipped data')
with BinaryReader(message.obj.data) as reader: with BinaryReader(message.obj.data) as reader:
try:
message.obj = reader.tgread_object() message.obj = reader.tgread_object()
except TypeNotFoundError as e:
# Received object which we don't know how to deserialize.
# This is somewhat expected while receiving updates, which
# will eventually trigger a gap error to recover from.
self._log.info('Type %08x not found, remaining data %r',
e.invalid_constructor_id, e.remaining)
else:
await self._process_message(message) await self._process_message(message)
async def _handle_update(self, message): async def _handle_update(self, message):