Handle plaintext events in tail history#210
Closed
arjunguha wants to merge 1 commit into
Closed
Conversation
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.
Collaborator
|
|
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. |
Owner
|
thank you @arjunguha for your contribution! it is appreciated. ❤️ |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.