Return allowed_room_ids in the client /hierarchy response - #20154
Open
barodeur wants to merge 6 commits into
Open
Return allowed_room_ids in the client /hierarchy response#20154barodeur wants to merge 6 commits into
allowed_room_ids in the client /hierarchy response#20154barodeur wants to merge 6 commits into
Conversation
Matrix 1.15 (MSC3266) added allowed_room_ids, room_version and encryption to the room summaries returned by the client hierarchy API. These tests assert the field is returned for local restricted rooms and passed through for remote rooms; they fail until the stripping is removed.
The field was deliberately removed from client responses in 2022 (matrix-org/synapse#12175) when the spec defined it for federation only. MSC3266, merged into the client-server spec in Matrix 1.15, made it a required property of client room summaries, so return it as-is.
MSC3266 has been merged into the spec since Matrix 1.15, so the spec text is the normative reference.
allowed_room_ids in the client /hierarchy response
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.
Part of #18731 (Support Matrix 1.15).
Since Matrix 1.15, the spec defines
allowed_room_idson the room summaries returned byGET /_matrix/client/v1/rooms/{roomId}/hierarchy, so that clients can tell whether a restricted room can be joined or only knocked at:Synapse currently strips the field from the client
/hierarchyresponse before returning it — a guard added in matrix-org/synapse#12175 (2022), correct at the time, when the spec defined the field for federation only and it was leaking into client responses. The other two surfaces that define the field (/room_summaryand the federation/hierarchy) already return it.This PR removes the strip in
_RoomEntry.as_json(and the now-unusedfor_clientparameter), so client hierarchy entries includeallowed_room_idsfor restricted rooms, both local and received over federation. The first commit adds the failing test coverage, the second removes the strip.Pull Request Checklist
EventStoretoEventWorkerStore.".code blocks.