Skip to content

Implement MSC4233: Remembering which server a user knocked through#19956

Open
ara4n wants to merge 4 commits into
developfrom
matthew/msc4233-knock-via
Open

Implement MSC4233: Remembering which server a user knocked through#19956
ara4n wants to merge 4 commits into
developfrom
matthew/msc4233-knock-via

Conversation

@ara4n

@ara4n ara4n commented Jul 14, 2026

Copy link
Copy Markdown
Member

Fixes #18030

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)

ara4n and others added 3 commits July 14, 2026 16:14
Fixes rescinding and denying knocks over federation (#18030):

- Remember the server that fulfilled our /send_knock in a new
  local_knock_via_servers table.
- Route a rescission of the knock (make_leave/send_leave) through that
  server, instead of only rescinding locally.
- Send a leave/ban denying a knock to the knocking user's server (the
  same mechanism as invite rescissions), and accept such an event as an
  out-of-band retraction on the knocking server when it references the
  knock in its auth events and comes from the server we knocked
  through (or the denying user's own server).

Gated behind the experimental msc4233_enabled flag.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uk8aPxHn3BHCe52L226jdG
Outliers never gain replaces_state, so clients could not tell a denied
knock (prev_content.membership == knock) from a plain kick. Reflect the
replaced knock event in the denial's unsigned ourselves.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uk8aPxHn3BHCe52L226jdG
MSC2403 gives a ban the same retracting effect as a kick. The sender and
receive sides already handled BAN; the storage layer did not — extend
the out-of-band membership assertions and the sliding-sync snapshot
handling (a ban denying a knock inherits the knock's metadata, like a
leave). Adds sender- and receive-side ban unit tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uk8aPxHn3BHCe52L226jdG
@ara4n
ara4n requested a review from a team as a code owner July 14, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rescinding or declining a room join request over federation is not implemented

2 participants