Merge remote-tracking branch 'upstream/release-v1.48'

This commit is contained in:
Tulir Asokan 2021-11-25 18:33:37 +02:00
commit 9f4fa40b64
175 changed files with 6413 additions and 1993 deletions

View file

@ -206,6 +206,10 @@ class DirectoryHandler:
)
room_id = await self._delete_association(room_alias)
if room_id is None:
# It's possible someone else deleted the association after the
# checks above, but before we did the deletion.
raise NotFoundError("Unknown room alias")
try:
await self._update_canonical_alias(requester, user_id, room_id, room_alias)
@ -227,7 +231,7 @@ class DirectoryHandler:
)
await self._delete_association(room_alias)
async def _delete_association(self, room_alias: RoomAlias) -> str:
async def _delete_association(self, room_alias: RoomAlias) -> Optional[str]:
if not self.hs.is_mine(room_alias):
raise SynapseError(400, "Room alias must be local")