From 07fb57be06447e0f98393008aeba436e27e26cdb Mon Sep 17 00:00:00 2001 From: Olivia Lee Date: Sat, 17 May 2025 18:52:05 -0700 Subject: [PATCH] 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. --- book/changelog.md | 3 +++ src/service/rooms/alias.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/book/changelog.md b/book/changelog.md index b0baf25f..8426be1a 100644 --- a/book/changelog.md +++ b/book/changelog.md @@ -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)) 28. Fix read receipts not being sent over federation (or only arbitrarily late) ([!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 diff --git a/src/service/rooms/alias.rs b/src/service/rooms/alias.rs index 638d4d92..29d72096 100644 --- a/src/service/rooms/alias.rs +++ b/src/service/rooms/alias.rs @@ -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) }