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

Commit a52c40e

Browse files
Fix get_users_in_room mis-use in transfer_room_state_on_room_upgrade (#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
1 parent ad4c14e commit a52c40e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

changelog.d/13960.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

synapse/handlers/room_member.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1150,8 +1150,8 @@ async def transfer_room_state_on_room_upgrade(
11501150
logger.info("Transferring room state from %s to %s", old_room_id, room_id)
11511151

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

11561156
# Add new room to the room directory if the old room was there
11571157
# Remove old room from the room directory

0 commit comments

Comments
 (0)