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

user_left_room distributor signal is unreliable #13673

Open
matrixbot opened this issue Dec 20, 2023 · 0 comments
Open

user_left_room distributor signal is unreliable #13673

matrixbot opened this issue Dec 20, 2023 · 0 comments

Comments

@matrixbot
Copy link
Collaborator

matrixbot commented Dec 20, 2023

This issue has been migrated from #13673.


In Synapse, there is a class called Distributor, which maintains a list of callbacks for a named signal and calls them all when the signal is fired: https://github.com/matrix-org/synapse/blob/develop/synapse/util/distributor.py#L43

There's only one signal defined currently and it's user_left_room, which is used in two places:

  1. DeviceHandler, to mark a remote user's device list as unsubscribed
    https://github.com/matrix-org/synapse/blob/1a209efdb2a6c51e52dd277de7581099852877ae/synapse/handlers/device.py#L569-L575
  2. TypingWriterHandler, to stop a user's typing indicator when they leave a room.
    https://github.com/matrix-org/synapse/blob/1a209efdb2a6c51e52dd277de7581099852877ae/synapse/handlers/typing.py#L311-L315

Unfortunately, the user_left_room signal is currently only reliable when local users leave a room normally (and not via a ban!).
This manifested as #13651 for device lists. Once #13651 is fixed, device list tracking will no longer use the signal.

We should look into whether the typing listener is necessary and if it can be moved elsewhere, so that we can eliminate this bit of architecture that's only used by one tiny part of synapse.

@matrixbot matrixbot changed the title Dummy issue user_left_room distributor signal is unreliable Dec 21, 2023
@matrixbot matrixbot reopened this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant