Skip to content

MSC4311: invites and knocks should contain the create event#19722

Merged
MadLittleMods merged 2 commits intoelement-hq:developfrom
famedly:tt/invite-knock-create-event
Apr 27, 2026
Merged

MSC4311: invites and knocks should contain the create event#19722
MadLittleMods merged 2 commits intoelement-hq:developfrom
famedly:tt/invite-knock-create-event

Conversation

@FrenchGithubUser
Copy link
Copy Markdown
Contributor

@FrenchGithubUser FrenchGithubUser commented Apr 23, 2026

Part of MSC4311: invites and knocks should contain the create event (stripped state for the client API)

Part of #19414

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

config = super().default_config()
return config

def test_create_event_present_in_invite_state(self) -> None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For reference, it looks like we also have TestMSC4311FullCreateEventOnStrippedState in Complement to cover invite_state. Although that test looks flawed

It looks like that test already passes on develop 🤔 How/why would that be the case?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like this is a combination of MSC1772 but it was only a recommendation. And MSC4311 changes that to a requirement

# Per MSC1772.
(EventTypes.Create, ""),

And then there was a flawed partial MSC4311 implementation introduced in 0eb7252. I'm reverting that change in #19723

Comment thread synapse/config/api.py
) -> Iterable[tuple[str, str | None]]:
"""Get the event types and state keys to include in the prejoin state."""
# MSC4311: the create event must always be included in invite/knock state.
yield EventTypes.Create, ""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this PR also cover including the full m.room.create event PDU in the invite_room_state/knock_room_state on m.room.member events (in unsigned)

This is coming from looking at #19414 and seeing the Server-Server (federation) changes mentioned as well for MSC4311

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With further understanding as I review this, my guess is no (which is fine, something for another PR)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

indeed, it doesn't cover including the full m.room.create event PDU

Comment thread tests/rest/client/test_sync.py Outdated
Comment thread tests/rest/client/test_sync.py Outdated
Comment thread tests/rest/client/test_sync.py Outdated
Comment thread tests/rest/client/test_sync.py Outdated
@MadLittleMods MadLittleMods mentioned this pull request Apr 23, 2026
35 tasks
Comment thread changelog.d/19722.feature Outdated
Comment thread tests/config/test_api.py Outdated
@FrenchGithubUser FrenchGithubUser force-pushed the tt/invite-knock-create-event branch from 4488101 to b661661 Compare April 27, 2026 09:19
@MadLittleMods MadLittleMods merged commit 449b1a4 into element-hq:develop Apr 27, 2026
72 of 75 checks passed
@MadLittleMods
Copy link
Copy Markdown
Contributor

Thanks for another step closer to spec compliance @FrenchGithubUser 🦈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants