mautrix / facebook

A Matrix-Facebook Messenger puppeting bridge
https://matrix.to/#/#facebook:maunium.net
GNU Affero General Public License v3.0
389 stars 64 forks source link

ReadReceipt errors after migrating to as_token authentication #325

Open baltitenger opened 1 year ago

baltitenger commented 1 year ago

Since I upgraded the bridge and migrating my configuration to use the as_token appservice authentication method for double puppeting, I often see the following errors in the log:

mau.user.@foo:bar.baz.mqtt: Error in OwnReadReceipt handler
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/maufbapi/mqtt/conn.py", line 524, in _dispatch
    await handler(evt)
  File "/usr/lib/python3.11/site-packages/mautrix/util/opt_prometheus.py", line 59, in wrapper
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mautrix_facebook/user.py", line 1263, in on_message_seen_self
    await portal.handle_facebook_seen(self, puppet, evt.read_to)
  File "/usr/lib/python3.11/site-packages/mautrix_facebook/portal.py", line 2383, in handle_facebook_seen
    await sender.intent_for(self).mark_read(msg.mx_room, msg.mxid)
  File "/usr/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 489, in mark_read
    await self.set_fully_read_marker(
  File "/usr/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 128, in wrapper
    return await __method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mautrix/client/api/modules/misc.py", line 113, in set_fully_read_marker
    await self.api.request(Method.POST, Path.v3.rooms[room_id].read_markers, content)
  File "/usr/lib/python3.11/site-packages/mautrix/api.py", line 415, in request
    resp_data, resp = await self._send(
                      ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mautrix/api.py", line 265, in _send
    raise make_request_error(
mautrix.errors.request.MUnknownToken: Invalid access token passed.
mau.user.@qux:bar.baz.mqtt: Error in ReadReceipt handler
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/maufbapi/mqtt/conn.py", line 524, in _dispatch
    await handler(evt)
  File "/usr/lib/python3.11/site-packages/mautrix/util/opt_prometheus.py", line 59, in wrapper
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mautrix_facebook/user.py", line 1255, in on_message_seen
    await portal.handle_facebook_seen(self, puppet, evt.read_to)
  File "/usr/lib/python3.11/site-packages/mautrix_facebook/portal.py", line 2383, in handle_facebook_seen
    await sender.intent_for(self).mark_read(msg.mx_room, msg.mxid)
  File "/usr/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 489, in mark_read
    await self.set_fully_read_marker(
  File "/usr/lib/python3.11/site-packages/mautrix/appservice/api/intent.py", line 128, in wrapper
    return await __method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mautrix/client/api/modules/misc.py", line 113, in set_fully_read_marker
    await self.api.request(Method.POST, Path.v3.rooms[room_id].read_markers, content)
  File "/usr/lib/python3.11/site-packages/mautrix/api.py", line 415, in request
    resp_data, resp = await self._send(
                      ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mautrix/api.py", line 265, in _send
    raise make_request_error(
mautrix.errors.request.MUnknownToken: Invalid access token passed.

Note that I logged out of the old sessions of the bridge from my matrix account, not sure if it's related.