-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Comments
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 againget_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_who_share_room_with_user(...)
should use the users_who_share_private_rooms
/users_in_public_rooms
tables instead of calculating it themselves againget_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)
IIRC those tables are populated by the user directory machinery. I vaguely remember that they were a little bit dodgy or inconsistent and had caveats to them: in particular a certain class of users were excluded from the user-sharing tables I think? synapse/synapse/storage/databases/main/user_directory.py Lines 399 to 433 in 888a29f
I'm struggling to find good references now for "a little bit dodgy". The best I can find is:
For context, I did a bunch of work around the user directory a year ago as part of addressing #5677 for local users. (Regrettably we do not yet have a good fix for this for remote users at present. It is tricky to do so without loss of functionality because per-room profiles are an "accident" of the protocol; or rather, the protocol has no profile-synchronising mechanism.) |
Ahh, good point @DMRobertson! I think this wouldn't matter for the presence stuff but it probably does matter for the device list stuff ( Maybe we should close this then? |
Maybe... but if this function is a bottleneck then maybe we should consider other approaches. Another angle might be to expand the room-sharing tables to hold information about all local users, and then add an extra boolean column which indicates whether each row is relevant for the user directory. |
get_users_who_share_room_with_user(...)
should use theusers_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.synapse/synapse/storage/databases/main/roommember.py
Lines 768 to 777 in 6f0c3e6
Discovered while working on #13958 and seeing code for users sharing rooms in #13966
See #13575 (comment) for the original exploration around finding
get_users_in_room
mis-uses.The text was updated successfully, but these errors were encountered: