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

get_users_who_share_room_with_user(...) should use the users_who_share_private_rooms/users_in_public_rooms tables instead of calculating it themselves again (get_users_in_room mis-use) #13967

Open
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 #13967.


get_users_who_share_room_with_user(...) should use the users_who_share_private_rooms/users_in_public_rooms tables instead of calculating it themselves again.

This might be a nice optimization for the presence and device list sharing code where get_users_who_share_room_with_user is used.

https://github.com/matrix-org/synapse/blob/6f0c3e669da458e838e7b4b165a13e8a5312d6d0/synapse/storage/databases/main/roommember.py#L768-L777


Discovered while working on matrix-org/synapse#13958 and seeing code for users sharing rooms in matrix-org/synapse#13966

See matrix-org/synapse#13575 (comment) for the original exploration around finding get_users_in_room mis-uses.

@matrixbot matrixbot changed the title Dummy issue get_users_who_share_room_with_user(...) should use the users_who_share_private_rooms/users_in_public_rooms tables instead of calculating it themselves again (get_users_in_room mis-use) 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