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

Avoid mutating cached room aliases. #15038

Merged
merged 2 commits into from Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/15038.bugfix
@@ -0,0 +1 @@
Fix a long-standing bug where the room aliases returned could be corrupted.
3 changes: 2 additions & 1 deletion synapse/handlers/directory.py
Expand Up @@ -485,7 +485,8 @@ async def edit_published_room_list(
)
)
if canonical_alias:
room_aliases.append(canonical_alias)
# Ensure we do not mutate room_aliases.
room_aliases = room_aliases + [canonical_alias]

if not self.config.roomdirectory.is_publishing_room_allowed(
user_id, room_id, room_aliases
Expand Down