Support Room version 12 as default for a homeserver being tested#885
Open
jason-famedly wants to merge 6 commits into
Open
Support Room version 12 as default for a homeserver being tested#885jason-famedly wants to merge 6 commits into
jason-famedly wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
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
userswhen the room version uses privileged creators. - Updates several federation tests to conditionally omit
m.room.createfromauth_eventsfor 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Largely, this is just "on-the-fly" adjustment of power levels to not contain the room creator, and removing the
m.room.createevent fromauth_eventsusing a splice. The former was easy to base on theRoomVersionhaving thePrivilegedCreatorsproperty(for MSC4289), the latter I chose to go with the existing propertyDomainlessRoomIDsas MSC4291 suggests it is where this requirement for nom.room.createevent inauth_eventscomes 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, thisDepends on:
Pull Request Checklist
Signed-off-by:
Jason Little <j.little@famedly.com>