-
-
Notifications
You must be signed in to change notification settings - Fork 583
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
Add CryptoApi.encryptToDeviceMessages() and deprecate Crypto.encryptAndSendToDevices() #4380
base: develop
Are you sure you want to change the base?
Conversation
Deprecate Crypto. encryptAndSendToDevices and MatrixClient. encryptAndSendToDevices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like the right general direction to me
src/crypto-api/index.ts
Outdated
* set of devices. | ||
* | ||
* @param eventType the type of the event to send | ||
* @param devices an array of (user ID, device ID) pairs to encrypt the payload for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can/should impart any advice about the maximum number of entries in devices
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A cursory look suggests that the limiting factor would be the size of the claim request generated by KeyClaimManager.ensureSessionsForUsers()
.
Might it make sense to batch that at some sensible level? Similar to the batch size of 20 that is imposed for actually sending the to-device events to the server.
As a user of the higher-level CryptoApi I think any batching would be done for me automatically (which currently isn't the case).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to add an integration test in spec/integ/crypto
that exercises the encryption without mocking out bits of OlmMachine. I'm aware that such things can be fiddly to get to work, though, so I won't insist.
BTW it looks like the description in the PR is a bit outdated -- could you give it a refresh? |
Fixes #3304
Depends on matrix-org/matrix-rust-sdk-crypto-wasm#140 and #4396
Checklist
public
/exported
symbols have accurate TSDoc documentation.