-
Notifications
You must be signed in to change notification settings - Fork 538
MSC4311: Use full PDU's in stripped state (like invite_room_state) over federation and always include m.room.create event
#19723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
MadLittleMods
wants to merge
25
commits into
develop
Choose a base branch
from
madlittlemods/remove-flawed-msc4311-partial-implementation
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
bdfeb90
Client side API's should still use stripped events with MSC4311
MadLittleMods 43a11f5
Add changelog
MadLittleMods 7f25120
Merge branch 'develop' into madlittlemods/remove-flawed-msc4311-parti…
MadLittleMods 6026aaa
Non-working: Use full PDU's for `invite_room_state` in federation
MadLittleMods e0eb224
Iteration that uses current state
MadLittleMods 3464ec8
Use `get_stripped_room_state_ids_from_event_context`
MadLittleMods f96c008
Invite event should be stripped when included in `invite_state`
MadLittleMods a088aa8
Sanitize `invite_room_state` received over federation
MadLittleMods 336b686
Fix test lints
MadLittleMods 22f4f20
Updated comment
MadLittleMods cce5dc7
Merge branch 'develop' into madlittlemods/remove-flawed-msc4311-parti…
MadLittleMods 7e379e7
Make the TODO more obvious
MadLittleMods 92d0d8b
Placeholder arg docstring
MadLittleMods 76b4905
Better logic/reasoning
MadLittleMods 5103f1b
Better comment flow
MadLittleMods 5c1f4ca
Use `FIXME(MSC4311)` prefix
MadLittleMods 374c4c5
Mark down create event after we verify it's valid
MadLittleMods ffe5c4b
Small comment to explain (we also explain above)
MadLittleMods 2b900b4
Better `invite_room_state` scrutiny
MadLittleMods 5e12cb8
Fix `events` typo
MadLittleMods ff533df
Event ID context
MadLittleMods de78d9e
Simplify logic to just use `hs.config.api.room_prejoin_state` instead…
MadLittleMods 4598a43
`_parse_stripped_room_state`
MadLittleMods fbff685
`_minimal_parse_stripped_room_state`
MadLittleMods 75a53ef
Strip the knock itself we add down `/sync`
MadLittleMods File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Remove flawed [MSC4311](https://github.com/matrix-org/matrix-spec-proposals/pull/4311) partial implementation: Client-side API's like `/sync` should still use stripped events. |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -490,7 +490,11 @@ async def on_PUT( | |
| # state resolution algorithm, and we don't use that for processing | ||
| # invites | ||
| result = await self.handler.on_invite_request( | ||
| origin, content, room_version_id=RoomVersions.V1.identifier | ||
| origin=origin, | ||
| expected_room_id=room_id, | ||
| expected_event_id=event_id, | ||
| event_json=content, | ||
| room_version_id=RoomVersions.V1.identifier, | ||
| ) | ||
|
|
||
| # V1 federation API is defined to return a content of `[200, {...}]` | ||
|
|
@@ -512,9 +516,6 @@ async def on_PUT( | |
| room_id: str, | ||
| event_id: str, | ||
| ) -> tuple[int, JsonDict]: | ||
| # TODO(paul): assert that room_id/event_id parsed from path actually | ||
| # match those given in content | ||
|
Comment on lines
-515
to
-516
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed as we actually do this now in |
||
|
|
||
| room_version = content["room_version"] | ||
| event = content["event"] | ||
| invite_room_state = content.get("invite_room_state", []) | ||
|
|
@@ -523,12 +524,15 @@ async def on_PUT( | |
| invite_room_state = [] | ||
|
|
||
| # Synapse expects invite_room_state to be in unsigned, as it is in v1 | ||
| # API | ||
|
|
||
| # API. We will sanitize this inside `on_invite_request(...)` | ||
| event.setdefault("unsigned", {})["invite_room_state"] = invite_room_state | ||
|
|
||
| result = await self.handler.on_invite_request( | ||
| origin, event, room_version_id=room_version | ||
| origin=origin, | ||
| expected_room_id=room_id, | ||
| expected_event_id=event_id, | ||
| event_json=event, | ||
| room_version_id=room_version, | ||
| ) | ||
|
|
||
| # We only store invite_room_state for internal use, so remove it before | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the flawed MSC4311 partial implementation