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

Commit

Permalink
Avoid mutating cached room aliases. (#15038)
Browse files Browse the repository at this point in the history
This might cause incorrect data in other callers which
are not expecting the canonical alias to be added into
the response.
  • Loading branch information
clokep authored Feb 9, 2023
1 parent 733531e commit 8a6e043
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/15038.bugfix
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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

0 comments on commit 8a6e043

Please sign in to comment.