MSC4311: Use full PDU's in stripped state (like invite_room_state) over federation and always include m.room.create event#19723
Draft
MadLittleMods wants to merge 10 commits into
Conversation
/sync should still use stripped events with MSC4311/sync should still use stripped events
/sync should still use stripped events/sync should still use stripped events
3 tasks
This was referenced May 2, 2026
MadLittleMods
commented
May 4, 2026
| and event.get_state_key() == "" | ||
| ): | ||
| return event.get_pdu_json() | ||
|
|
Contributor
Author
MadLittleMods
commented
May 4, 2026
|
|
||
| return [strip_event(e) for e in state_to_include.values()] | ||
|
|
||
| async def get_stripped_room_state_ids_from_event_context( |
Contributor
Author
There was a problem hiding this comment.
Split some logic out of get_stripped_room_state_from_event_context(...) into get_stripped_room_state_ids_from_event_context(...)
This way we can use the same event selection logic but fetch/format them however we see fit.
MadLittleMods
commented
May 4, 2026
Comment on lines
-515
to
-516
| # TODO(paul): assert that room_id/event_id parsed from path actually | ||
| # match those given in content |
Contributor
Author
There was a problem hiding this comment.
Removed as we actually do this now in FederationServer.on_invite_request(...)
/sync should still use stripped eventsinvite_room_state) over federation and always include m.room.create event
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.
Background
This PR was originally just trying to remove the flawed MSC4311 partial implementation as client side API's like
/syncshould still use stripped events. But it turns out we were just re-using the client logic for the federation side and things might break if we didn't include the fullm.room.createevent so this PR now introduces MSC4311 support to use full PDU's in theinvite_room_state/knock_room_statein the federation API's.The flawed implementation was originally introduced in 0eb7252 (no PR I assume because part of Hydra security fix)
Spawning from reviewing #19722 and noticing that we have
TestMSC4311FullCreateEventOnStrippedStatein Complement which already passes even though that test looks flawed:What does this PR do?
invite_room_state/knock_room_stateover federationinvite_room_state/knock_room_stateover federationComplement tests: matrix-org/complement#796
Part of #19414
Dev notes
Todo
TestMSC4311FullCreateEventOnStrippedStateComplement test so it doesn't look for the full PDU in/sync.knock_room_statein this PRknock_room_statePull Request Checklist
EventStoretoEventWorkerStore.".code blocks.