mautrix / telegram

A Matrix-Telegram hybrid puppeting/relaybot bridge
https://matrix.to/#/#telegram:maunium.net
GNU Affero General Public License v3.0
1.33k stars 175 forks source link

Bridge doesn't send read receipts to TG #474

Closed olmari closed 4 years ago

olmari commented 4 years ago

After some relatively recent'ish bridge (I rarely look on official telegram client so I really can't tell any better) bridge doesn't seem to send any read receipts onto telegram. Official client is full of unread message counters and mention-tags etc, while on matrix-side everything is read. We are using auto-login-matrix, send-delivery-reports, e2be, should any of those matter.

Some picks from bridge logs, no idea how relative they are but everything I could find grepping "Failed to" and then separately "receipt"

/opt/telegrambot/mautrix-telegram.log.9:[2020-05-29 17:44:26,126] [ERROR@mau.portal.284794645<->149362243] Failed to send delivery receipt for $6VxB5mmYQldH62ruv-NlHjXfF7xzl1Eq1Uj7HBuw3zo
/opt/telegrambot/mautrix-telegram.log.9-Traceback (most recent call last):
/opt/telegrambot/mautrix-telegram.log.9-  File "/opt/telegrambot/lib/python3.7/site-packages/mautrix/appservice/api/intent.py", line 357, in ensure_joined
/opt/telegrambot/mautrix-telegram.log.9-    await self.join_room(room_id, max_retries=0)
/opt/telegrambot/mautrix-telegram.log.9-  File "/opt/telegrambot/lib/python3.7/site-packages/mautrix/appservice/api/intent.py", line 75, in wrapper
/opt/telegrambot/mautrix-telegram.log.9-    return await __method(*args, **kwargs)
/opt/telegrambot/mautrix-telegram.log.9-  File "/opt/telegrambot/lib/python3.7/site-packages/mautrix/client/api/rooms.py", line 253, in join_room
/opt/telegrambot/mautrix-telegram.log.9-    content=content, query_params=query_params)
/opt/telegrambot/mautrix-telegram.log.9-  File "/opt/telegrambot/lib/python3.7/site-packages/mautrix/api/http.py", line 203, in request
/opt/telegrambot/mautrix-telegram.log.9-    return await self._send(method, endpoint, content, query_params, headers or {})
/opt/telegrambot/mautrix-telegram.log.9-  File "/opt/telegrambot/lib/python3.7/site-packages/mautrix/api/http.py", line 145, in _send
/opt/telegrambot/mautrix-telegram.log.9-    errcode=errcode, message=message)
/opt/telegrambot/mautrix-telegram.log.9-mautrix.errors.request.MForbidden: You are not invited to this room.
/opt/telegrambot/mautrix-telegram.log.9-
/opt/telegrambot/mautrix-telegram.log.9-The above exception was the direct cause of the following exception:
/opt/telegrambot/mautrix-telegram.log.9-
/opt/telegrambot/mautrix-telegram.log.9-Traceback (most recent call last):
/opt/telegrambot/mautrix-telegram.log.9-  File "/opt/telegrambot/lib/python3.7/site-packages/mautrix_telegram/portal/matrix.py", line 234, in _send_delivery_receipt
/opt/telegrambot/mautrix-telegram.log.9-    await self.az.intent.mark_read(self.mxid, event_id)
/opt/telegrambot/mautrix-telegram.log.9-  File "/opt/telegrambot/lib/python3.7/site-packages/mautrix/appservice/api/intent.py", line 344, in mark_read
/opt/telegrambot/mautrix-telegram.log.9-    await self.set_fully_read_marker(room_id, fully_read=event_id, read_receipt=event_id)
/opt/telegrambot/mautrix-telegram.log.9-  File "/opt/telegrambot/lib/python3.7/site-packages/mautrix/appservice/api/intent.py", line 86, in wrapper
/opt/telegrambot/mautrix-telegram.log.9-    await __self.ensure_joined(room_id)
/opt/telegrambot/mautrix-telegram.log.9-  File "/opt/telegrambot/lib/python3.7/site-packages/mautrix/appservice/api/intent.py", line 361, in ensure_joined
/opt/telegrambot/mautrix-telegram.log.9:    raise IntentError(f"Failed to join room {room_id} as {self.mxid}") from e
/opt/telegrambot/mautrix-telegram.log.9:mautrix.errors.base.IntentError: Failed to join room !VmAxCraSsgdAJykqDJ:hacklab.fi as @telegrambot:hacklab.fi

Then again I see absolutely no errors on grepping some known group rooms ID and yet no read receipts go there either on TG-side.

olmari commented 4 years ago

Hm.. Now when I try to look things, this seems to generally work better than yesterday, read receipts seems definately flow when should, while I still see unread messages bubble on telegram side on some group that I have definately read on matrix side, could be remnants of something...

I did change encrypt default to true and restarted bridge, and updated to very latest version, which had namely bumb version rather than anything else meaningful happened..

I guess I close this issue then, because it does seem to work at least generally, and I'm none the wiser what could possibly be the issue..

I still do see occasional errors described in first post popping in logs for reason or another.