Added /upgrade endpoint (#2307)

* Added /upgrade endpoint

* fix

* Fix lints

* More lint lifex

* Move room upgrading to the roomserver

* Remove extraneous arg

* Fix HTTP API for `PerformUpgrade`

* Reduce number of API calls in `generateInitialEvents`, preserve membership fields

* Refactor `generateInitialEvents` to preserve old state events for all but the essential room setup events

* Handle ban events in the state transfer

* Refactor and comment `createTemporaryPowerLevels`

* Only send two power levels if we needed to override the levels, preserve miscellaneous fields in the create event

* Fix copyrights

* Review comments @S7evinK

* Update sytest whitelist

* Specify empty state keys, use `EventLevel`, remove unnecessary check on state copy

* Add comment to `restrictOldRoomPowerLevels`

* Ensure canonical aliases exist before clearing

* Copy invites as well as bans

* Fix return error on `m.room.tombstone` handling in client API

* Relax checks for well-formedness of join rules, membership event etc

Co-authored-by: Alex Kursell <alex@awk.run>
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Co-authored-by: kegsay <kegan@matrix.org>
This commit is contained in:
David Spenler 2022-04-05 05:04:08 -04:00 committed by GitHub
parent 562d742240
commit 2defc4249d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 905 additions and 0 deletions

View file

@ -661,4 +661,22 @@ Canonical alias can include alt_aliases
Can delete canonical alias
AS can make room aliases
/context/ with lazy_load_members filter works
/upgrade creates a new room
/upgrade should preserve room visibility for public rooms
/upgrade should preserve room visibility for private rooms
/upgrade copies the power levels to the new room
/upgrade preserves the power level of the upgrading user in old and new rooms
/upgrade copies important state to the new room
/upgrade copies ban events to the new room
local user has push rules copied to upgraded room
remote user has push rules copied to upgraded room
/upgrade moves aliases to the new room
/upgrade preserves room federation ability
/upgrade restricts power levels in the old room
/upgrade restricts power levels in the old room when the old PLs are unusual
/upgrade to an unknown version is rejected
/upgrade is rejected if the user can't send state events
/upgrade of a bogus room fails gracefully
Cannot send tombstone event that points to the same room
Room summary counts change when membership changes
/upgrade copies >100 power levels to the new room