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

Consider not duplicating the crypto API on MatrixClient #17488

Open
turt2live opened this issue May 28, 2021 · 4 comments
Open

Consider not duplicating the crypto API on MatrixClient #17488

turt2live opened this issue May 28, 2021 · 4 comments

Comments

@turt2live
Copy link
Member

we really just need a isCryptoEnabled flag and the rest can just NPE if people fail to handle client.crypto being null....

@jryans
Copy link
Collaborator

jryans commented May 28, 2021

Yes, I've never quite been sure why we duplicate most crypto methods onto the client... 🤔

@turt2live
Copy link
Member Author

ftr, I'm translating them verbatim in a typescript conversion but one day I'd like us to remove the ~1700 lines of code from MatrixClient.

@richvdh
Copy link
Member

richvdh commented Nov 14, 2022

Yes, I've never quite been sure why we duplicate most crypto methods onto the client...

The reason it's done like that is to separate the internal interface of the Crypto module/object from the public one. But certainly it's ended up as a big mess with lots of stupid stub methods in MatrixClient.

My goal is to make the Crypto module properly internal as part of #21972. As part of that I can look into replacing it with two interfaces: a public one exposed to the application by, say, client.getCrypto(), and an internal one only to be used by other parts of the js-sdk.

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

No branches or pull requests

3 participants