remove local aliases from old room on upgrade

Without explicitly removing the old alias when reassigning aliases, we
were listing the alias on both rooms in the GET client/v3/rooms/{roomId}/aliases
endpoint. Resolving the alias still always pointed to the correct room.
This commit is contained in:
Olivia Lee 2025-05-17 18:52:05 -07:00
parent 48ecf50973
commit 07fb57be06
No known key found for this signature in database
GPG key ID: 54D568A15B9CD1F9
2 changed files with 6 additions and 0 deletions

View file

@ -40,6 +40,9 @@ impl Service {
));
}
if self.resolve_local_alias(alias)?.is_some() {
self.remove_alias(alias, user_id)?;
}
self.db.set_alias(alias, room_id)
}