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

@ -242,6 +242,9 @@ This will be the first release of Grapevine since it was forked from Conduit
([!158](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/158)) ([!158](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/158))
28. Fix read receipts not being sent over federation (or only arbitrarily late) 28. Fix read receipts not being sent over federation (or only arbitrarily late)
([!162](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/162)) ([!162](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/162))
29. Remove local aliases from old room when assigning them to a new room during
a room upgrade.
([!186](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/186))
### Added ### Added

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) self.db.set_alias(alias, room_id)
} }