Skip to content

feat: Add support for MSC4471 event streams#6607

Draft
bradtgmurray wants to merge 7 commits into
matrix-org:mainfrom
bradtgmurray:msc4471-event-streams
Draft

feat: Add support for MSC4471 event streams#6607
bradtgmurray wants to merge 7 commits into
matrix-org:mainfrom
bradtgmurray:msc4471-event-streams

Conversation

@bradtgmurray

@bradtgmurray bradtgmurray commented May 22, 2026

Copy link
Copy Markdown

Added an initial implementation of a portion of MSC4471. Included in this pull request is the the matrix-sdk changes, validated by unit tests. Not included in this pull request is changes to matrix-sdk-ui, which I figured would be best done as a follow up to keep this original PR a reasonable size. Also, encryption of the stream events is not yet implemented, again to manage the size of this initial PR.

This MSC has not been merged, but I'd like to use matrix-rust-sdk as a testing ground for it.

My experience with Rust is rather light, and I did use AI to assist me in writing this PR, but I did quite a bit of iteration to make something that looks reasonably good to my inexperienced eyes. Feedback is greatly appreciated!

  • I've documented the public API changes in the appropriate changelog files
  • This PR was made with the help of AI.

NOTE: This pull request isn't mergable as is as it's dependant on me adding the appropriate types to Ruma. Unfortunately, it looks like Ruma does not permit AI-assissted changes, so my work isn't mergable as is. I would love some advice on how to proceed on that front. For now, this branch has adjusted the dependency to point to my fork of Ruma, but that is obviously not a good idea to merge like that.

Signed-off-by: Brad Murray bradtgmurray@gmail.com

@bradtgmurray bradtgmurray changed the title sdk: Add support for MSC4471 event streams feat: Add support for MSC4471 event streams May 22, 2026
@codspeed-hq

codspeed-hq Bot commented May 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing bradtgmurray:msc4471-event-streams (18e2958) with main (c0fde33)

Open in CodSpeed

@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.41815% with 132 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.99%. Comparing base (c0fde33) to head (18e2958).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/event_streams/publisher.rs 91.64% 50 Missing and 20 partials ⚠️
crates/matrix-sdk/src/room/event_streams.rs 36.66% 36 Missing and 2 partials ⚠️
...rates/matrix-sdk/src/event_streams/subscription.rs 98.20% 10 Missing and 4 partials ⚠️
crates/matrix-sdk/src/event_streams/mod.rs 76.74% 8 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6607      +/-   ##
==========================================
+ Coverage   89.95%   89.99%   +0.03%     
==========================================
  Files         382      386       +4     
  Lines      107979   109717    +1738     
  Branches   107979   109717    +1738     
==========================================
+ Hits        97135    98739    +1604     
- Misses       7171     7277     +106     
- Partials     3673     3701      +28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Hywan

Hywan commented May 26, 2026

Copy link
Copy Markdown
Member

Hello,

Thank you for the contribution. Do you know if there is a homeserver implementation too?

@Hywan

Hywan commented May 26, 2026

Copy link
Copy Markdown
Member

Before reviewing this very large PR, I prefer to wait a bit to see how it's going to land in Ruma and how the MSC is going to be received. A lot is susceptible to change rapidly. I'm converting the PR as a draft for the moment if you don't mind so that it's clear all this is unstable.

@Hywan Hywan marked this pull request as draft May 26, 2026 14:01
@bradtgmurray

Copy link
Copy Markdown
Author

Makes sense! I'm going to keep on pushing the implementation forward, would you prefer for me to keep the UI + Multiverse implementation as a follow up PR or include it in this already large branch?

My goal is to get a branch going that's good enough to experiment with, and if the MSC progresses forward we can worry about upstreaming it here then.

@Hywan

Hywan commented May 26, 2026

Copy link
Copy Markdown
Member

As long as it's behind a flag, you are free to do what you want, but it's preferable to keep PR as small as possible. Stacked PRs are nice to have.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants