Skip to content

Support Room version 12 as default for a homeserver being tested#885

Open
jason-famedly wants to merge 6 commits into
matrix-org:mainfrom
famedly:jason/roomv12
Open

Support Room version 12 as default for a homeserver being tested#885
jason-famedly wants to merge 6 commits into
matrix-org:mainfrom
famedly:jason/roomv12

Conversation

@jason-famedly

Copy link
Copy Markdown

Largely, this is just "on-the-fly" adjustment of power levels to not contain the room creator, and removing the m.room.create event from auth_events using a splice. The former was easy to base on the RoomVersion having the PrivilegedCreators property(for MSC4289), the latter I chose to go with the existing property DomainlessRoomIDs as MSC4291 suggests it is where this requirement for no m.room.create event in auth_events comes from.

For the regression test TestDemotingUsersViaUsersDefault, I opted to change the basis of the test to a different user, to work around the room's creator having an infinite power level.

To fix TestOutboundFederationIgnoresMissingEventWithBadJSONForRoomVersion6, this
Depends on:

Pull Request Checklist

Signed-off-by: Jason Little <j.little@famedly.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Complement’s test suite to remain valid when the homeserver under test defaults to Matrix room version 12, accounting for (a) privileged room creators (MSC4289) and (b) the v12+ restriction around excluding m.room.create from auth_events (MSC4291).

Changes:

  • Adjusts power level event construction in multiple tests to omit the room creator from users when the room version uses privileged creators.
  • Updates several federation tests to conditionally omit m.room.create from auth_events for room versions which disallow it.
  • Refactors a regression test to use a non-creator user to avoid the creator’s non-JSON-representable power level.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/msc3902/federation_room_join_partial_state_test.go Conditionally omits creator from PL users and drops m.room.create from auth_events for v12+ in partial-state join scenarios.
tests/federation_room_event_auth_test.go Adjusts crafted auth_events lists to avoid including m.room.create on room versions that disallow it.
tests/csapi/power_levels_test.go Updates CSAPI power level tests for privileged creators and v12 behavior; switches one test to use a non-creator sender.
tests/csapi/apidoc_room_members_test.go Updates reinvite scenario PL content to omit creator from users for privileged-creators rooms.
tests/csapi/apidoc_room_alias_test.go Updates alias permission tests’ PL content to omit creator from users for privileged-creators rooms.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +125 to 129
// This key should be missing for room v12+
if gomatrixserverlib.MustGetRoomVersion(defaultRoomVersion).PrivilegedCreators() {
match.JSONKeyMissing("users." + client.GjsonEscape(alice.UserID))
return nil
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants