You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Add MatrixEvent.attemptDecryption
... and use it from both MatrixClient and the megolm re-decryption code. This will help us avoid races when decryption is asynchronous.
This commit is contained in:
@@ -842,13 +842,7 @@ MegolmDecryption.prototype._retryDecryption = function(senderKey, sessionId) {
|
||||
delete this._pendingEvents[k];
|
||||
|
||||
for (let i = 0; i < pending.length; i++) {
|
||||
try {
|
||||
// no point sending another m.room_key_request here.
|
||||
this._decryptEvent(pending[i], false);
|
||||
console.log("successful re-decryption of", pending[i]);
|
||||
} catch (e) {
|
||||
console.log("Still can't decrypt", pending[i], e.stack || e);
|
||||
}
|
||||
pending[i].attemptDecryption(this._crypto);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user