You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prepareToEncrypt is introduced in #1252 so that applications can pre-send keys to recipients before the message itself is ready to send, reducing the amount of work that needs to be done when the message is sent.
However, the current function cannot be cancelled if the key cannot be used after all (e.g. a user/device has left, so the key needs to be rotated).
The text was updated successfully, but these errors were encountered:
The most straightforward option would be to break the work up into chunks, wrapped in setImmediate (or similar). Allow preemption between each checkDeviceTrust call. Then, cancellation could be added, and element-hq/element-web#21612 resolved (probably).
The "correct" solution would probably be to move the expensive crypto off the main thread, using a WebWorker or something. I don't think that's super reasonable, though, and would require some really sweeping changes.
clarkf
added a commit
to clarkf/matrix-js-sdk
that referenced
this issue
Jan 8, 2023
NOTE: This commit introduces a backwards-compatible API change.
Adds the ability to cancel `MegolmEncryption#prepareToEncrypt` by returning
a cancellation function. The bulk of the processing happens in
`getDevicesInRoom`, which now accepts a 'getter' that allows the caller to
indicate cancellation.
See matrix-org#1255Closesmatrix-org#1255
Signed-off-by: Clark Fischer <[email protected]>
prepareToEncrypt
is introduced in #1252 so that applications can pre-send keys to recipients before the message itself is ready to send, reducing the amount of work that needs to be done when the message is sent.However, the current function cannot be cancelled if the key cannot be used after all (e.g. a user/device has left, so the key needs to be rotated).
The text was updated successfully, but these errors were encountered: