1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Fix the tests and add a test

This commit is contained in:
Brad Murray
2021-07-25 11:41:08 -04:00
parent 04cd9b55f7
commit e85b3b6a8d
2 changed files with 65 additions and 1 deletions

View File

@@ -534,7 +534,7 @@ export class MatrixEvent extends EventEmitter {
throw new Error("Attempt to decrypt event which isn't encrypted");
}
if (this.isDecryptionFailure()) {
if (this.clearEvent?.content && this.clearEvent.content.msgtype !== "m.bad.encrypted") {
// 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",