Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbridging / Portal deletion fails if a ghost user cannot be removed #923

Open
tux93 opened this issue Jun 21, 2023 · 3 comments
Open

Unbridging / Portal deletion fails if a ghost user cannot be removed #923

tux93 opened this issue Jun 21, 2023 · 3 comments

Comments

@tux93
Copy link

tux93 commented Jun 21, 2023

When unbridging a room and the bot fails to remove a ghost user an exception is thrown and the bridge remains in place.

Traceback (most recent call last):
  File "/home/telegram/mautrix-telegram/lib64/python3.11/site-packages/mautrix/bridge/commands/handler.py", line 491, in handle
    await self._run_handler(handler, evt)
  File "/home/telegram/mautrix-telegram/lib64/python3.11/site-packages/mautrix_telegram/commands/handler.py", line 192, in _run_handler
    return await handler(evt)
           ^^^^^^^^^^^^^^^^^^
  File "/home/telegram/mautrix-telegram/lib64/python3.11/site-packages/mautrix_telegram/commands/portal/unbridge.py", line 54, in post_confirm
    await function()
  File "/home/telegram/mautrix-telegram/lib64/python3.11/site-packages/mautrix/bridge/portal.py", line 514, in unbridge
    await self.cleanup_portal("Room unbridged", puppets_only=True)
  File "/home/telegram/mautrix-telegram/lib64/python3.11/site-packages/mautrix_telegram/portal.py", line 3875, in cleanup_portal
    await self.cleanup_room(self.main_intent, self.mxid, message, puppets_only)
  File "/home/telegram/mautrix-telegram/lib64/python3.11/site-packages/mautrix/bridge/portal.py", line 485, in cleanup_room
    await puppet.default_mxid_intent.leave_room(room_id)
  File "/home/telegram/mautrix-telegram/lib64/python3.11/site-packages/mautrix/appservice/api/intent.py", line 128, in wrapper
    return await __method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/telegram/mautrix-telegram/lib64/python3.11/site-packages/mautrix/appservice/api/intent.py", line 308, in leave_room
    await super().leave_room(room_id, reason, extra_content, raise_not_in_room)
  File "/home/telegram/mautrix-telegram/lib64/python3.11/site-packages/mautrix/client/store_updater.py", line 76, in leave_room
    await super().leave_room(room_id, reason, extra_content, raise_not_in_room)
  File "/home/telegram/mautrix-telegram/lib64/python3.11/site-packages/mautrix/client/api/rooms.py", line 495, in leave_room
    await self.api.request(Method.POST, Path.v3.rooms[room_id].leave, content=data)
  File "/home/telegram/mautrix-telegram/lib64/python3.11/site-packages/mautrix/api.py", line 395, in request
    resp_data, resp = await self._send(
                      ^^^^^^^^^^^^^^^^^
  File "/home/telegram/mautrix-telegram/lib64/python3.11/site-packages/mautrix/api.py", line 250, in _send
    raise make_request_error(
mautrix.errors.request.MUnknown: user "@telegram_XXX:ZZZ" is not a member of room "!YYY:ZZZ"

It would be nice if the bridge would just ignore the failed remove and proceed with the removal of the bridge.

@tulir
Copy link
Member

tulir commented Jun 21, 2023

Is this on some unstable server implementation like Dendrite? Probably another one of the state bugs there if so

@tux93
Copy link
Author

tux93 commented Jun 21, 2023

It is Dendrite indeed, still it would be nice if the exception would be handled and not block the unbridging

@sumnerevans
Copy link
Member

I'd say that the bridge is doing the right thing here. Bridges should be able to assume that servers don't totally fail to maintain state properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants