Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix get_users_in_room mis-use in `transfer_room_state_on_room_upgra…
Browse files Browse the repository at this point in the history
…de` (#13960)

Spawning from looking into `get_users_in_room` while investigating #13942 (comment).

See #13575 (comment) for the original exploration around finding `get_users_in_room` mis-uses.

Related to the following PRs where we also cleaned up some `get_users_in_room` mis-uses:

 - #13605
 - #13608
 - #13606
 - #13958
  • Loading branch information
MadLittleMods authored Oct 1, 2022
1 parent ad4c14e commit a52c40e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/13960.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use dedicated `get_local_users_in_room(room_id)` function to find local users when calculating users to copy over during a room upgrade.
4 changes: 2 additions & 2 deletions synapse/handlers/room_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,8 @@ async def transfer_room_state_on_room_upgrade(
logger.info("Transferring room state from %s to %s", old_room_id, room_id)

# Find all local users that were in the old room and copy over each user's state
users = await self.store.get_users_in_room(old_room_id)
await self.copy_user_state_on_room_upgrade(old_room_id, room_id, users)
local_users = await self.store.get_local_users_in_room(old_room_id)
await self.copy_user_state_on_room_upgrade(old_room_id, room_id, local_users)

# Add new room to the room directory if the old room was there
# Remove old room from the room directory
Expand Down

0 comments on commit a52c40e

Please sign in to comment.