Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MatrixEvent.getOriginalContent seems to be lying about types, hindering threading in some clients #4631

Closed
filipesmedeiros opened this issue Jan 20, 2025 · 3 comments
Labels

Comments

@filipesmedeiros
Copy link

According to some investigation done in cinnyapp/cinny#2047, MatrixEvent.getOriginalContent seems to be lying about the type of the returned content, more specifically when it returns an IClearEvent but says it returns an IContent (I think, please forgive any mistakes).

This seems to be leading to some clients (or at least Cinny) to be unable to properly thread messages, because they fail to understand when a message is threaded or not.

There are more details in the issue linked above, but I can give more information if needed.

Thanks!

@filipesmedeiros filipesmedeiros changed the title MatrixEvent.getOriginalContent seems to be lying about types MatrixEvent.getOriginalContent seems to be lying about types, hindering threading in some clients Jan 20, 2025
@dosubot dosubot bot added the T-Defect label Jan 20, 2025
@t3chguy
Copy link
Member

t3chguy commented Jan 20, 2025

Image

As you can see by the code, it does not return IClearEvent, it returns IClearEvent["content"] which is a subset of IContent - given IContent has all of its fields optional they are exchangeable like this

Image

@t3chguy
Copy link
Member

t3chguy commented Jan 20, 2025

The content types are awfully weak due to lack of runtime type checking against what comes down from the server.

The right method to use for Cinny would be getRelation or as that method does, getWireContent

Image

Closing as a downstream issue using the wrong method.

The IClearEvent interface explicitly excludes m.relates_to so expecting to have the relationship is asking for trouble

Image

@t3chguy t3chguy closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2025
@filipesmedeiros
Copy link
Author

Thanks for the quick help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants