element-hq / element-hq/synapse

`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)

Open
#13,967 0 comments 0 reactions 0 assignees View on GitHub
A-Performance T-Enhancement
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#13967](https://github.com/matrix-org/synapse/issues/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 https://github.com/matrix-org/synapse/pull/13958 and seeing code for users sharing rooms in https://github.com/matrix-org/synapse/pull/13966*

*See https://github.com/matrix-org/synapse/pull/13575#discussion_r953023755 for the original exploration around finding `get_users_in_room` mis-uses.*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.