Catch errors when updating read status or tags. Fixes #812

This commit is contained in:
Tulir Asokan
2022-09-20 11:11:59 +03:00
parent 4210091e9a
commit b2daebead6
+3
View File
@@ -582,6 +582,7 @@ class User(DBUser, AbstractUser, BaseUser):
last_read = await DBMessage.get_one_by_tgid( last_read = await DBMessage.get_one_by_tgid(
portal.tgid, tg_space, dialog.dialog.read_inbox_max_id portal.tgid, tg_space, dialog.dialog.read_inbox_max_id
) )
try:
if last_read: if last_read:
await puppet.intent.mark_read(last_read.mx_room, last_read.mxid) await puppet.intent.mark_read(last_read.mx_room, last_read.mxid)
if was_created or not self.config["bridge.tag_only_on_create"]: if was_created or not self.config["bridge.tag_only_on_create"]:
@@ -592,6 +593,8 @@ class User(DBUser, AbstractUser, BaseUser):
await self._tag_room( await self._tag_room(
puppet, portal, self.config["bridge.archive_tag"], dialog.archived puppet, portal, self.config["bridge.archive_tag"], dialog.archived
) )
except Exception:
self.log.exception(f"Error updating read status and tags for {portal.tgid_log}")
async def get_cached_portals(self) -> dict[tuple[TelegramID, TelegramID], po.Portal]: async def get_cached_portals(self) -> dict[tuple[TelegramID, TelegramID], po.Portal]:
if self._portals_cache is None: if self._portals_cache is None: