transfer local canonical aliases to new room on upgrade

When upgrading rooms, we reassign any local aliases from the old room to
the new room. This commit updates the m.room.canonical_alias events in
the old and new rooms to reflect which aliases were moved. The spec is
unclear on whether the server should do this[1], but it's consistent
with synapse's behavior.

I went with putting the canonical alias update logic inline, rather than
something like add_canonical_alias and remove_canonical_alias helper
functions to the alias service, because it's desirable to have the alias
updates be sent as a single event than a separate event for each change.

[1]: https://github.com/matrix-org/matrix-spec/issues/2142
This commit is contained in:
Olivia Lee 2025-05-18 12:29:32 -07:00
parent 07fb57be06
commit a34bca3986
No known key found for this signature in database
GPG key ID: 54D568A15B9CD1F9
2 changed files with 77 additions and 0 deletions

View file

@ -327,3 +327,5 @@ This will be the first release of Grapevine since it was forked from Conduit
([!124](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/124))
26. Allow adding canonical aliases from remote servers.
([!158](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/158))
27. Transfer local canonical aliases to the new room when upgrading a room.
([!186](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/186))