You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-07 23:02:56 +03:00
Fix reattempting decryption check
This commit is contained in:
@@ -274,7 +274,7 @@ describe("Crypto", function() {
|
||||
// alice encrypts each event, and then bob tries to decrypt
|
||||
// them without any keys, so that they'll be in pending
|
||||
await aliceClient.crypto.encryptEvent(event, aliceRoom);
|
||||
event.clearEvent = {};
|
||||
event.clearEvent = undefined;
|
||||
event.senderCurve25519Key = null;
|
||||
event.claimedEd25519Key = null;
|
||||
try {
|
||||
|
@@ -534,7 +534,7 @@ export class MatrixEvent extends EventEmitter {
|
||||
throw new Error("Attempt to decrypt event which isn't encrypted");
|
||||
}
|
||||
|
||||
if (this.clearEvent?.content && this.clearEvent.content.msgtype !== "m.bad.encrypted") {
|
||||
if (this.clearEvent && !this.isDecryptionFailure()) {
|
||||
// we may want to just ignore this? let's start with rejecting it.
|
||||
throw new Error(
|
||||
"Attempt to decrypt event which has already been decrypted",
|
||||
|
Reference in New Issue
Block a user