Fix telethon not saving update state outside of disconnect. Fixes catch up

This commit is contained in:
Nitan Alexandru Marcel 2023-03-27 17:13:22 +03:00 committed by GitHub
parent 516a2e7435
commit 9bfc49e405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -467,6 +467,9 @@ class UpdateMethods:
# inserted because this is a rather expensive operation
# (default's sqlite3 takes ~0.1s to commit changes). Do
# it every minute instead. No-op if there's nothing new.
ss, cs = self._message_box.session_state()
self.session.set_update_state(0, types.updates.State(**ss, unread_count=0))
self.session.save()
async def _dispatch_update(self: 'TelegramClient', update):