Skip to content

Handle plaintext events in tail history#210

Closed
arjunguha wants to merge 1 commit into
8go:mainfrom
arjunguha:main
Closed

Handle plaintext events in tail history#210
arjunguha wants to merge 1 commit into
8go:mainfrom
arjunguha:main

Conversation

@arjunguha

Copy link
Copy Markdown

My apologies in advance if you don’t want to see AI code. I don’t know the Matrix protocol but I do know Rust well enough.

I’m using a matrix server that uses unencrypted rooms. The tail command was failing, but works with these changes. I am happy to shepherd this further.

There is some weirdness with ownership here — the plaintext event needs conversion to be compatible with the other match arms, and could not be borrowed—I think. That required decrypted to be owned too. I’m not pleased about that change but happy to take suggestions.

The tail listener had an if-let that handled decrypted paginated history and routed every other timeline kind through the existing undecryptable-event fallback. That made plaintext events from unencrypted rooms look undecryptable.

Turn that if-let into a match whose successful arms produce owned AnyTimelineEvent values. The decrypted arm deserializes the existing raw decrypted event, the new PlainText arm deserializes the sync event and converts it with into_full_event(roomid.clone()), and the fallback case is left unchanged.

Verified with cargo build, cargo test, and the original live JSON tail command.
@Benjamin-Loison

Copy link
Copy Markdown
Collaborator

roomid was what I was missing, thank you for the contribution, but #211 looks cleaner.

@arjunguha

Copy link
Copy Markdown
Author

Great! I had that version as well. I wasn’t sure if there were safety implicated of the unchecked call, which is why I went this route. Anyway, I’ll sync with your main. Thanks.

@8go

8go commented Jul 2, 2026

Copy link
Copy Markdown
Owner

thank you @arjunguha for your contribution! it is appreciated. ❤️

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