You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
Add a catch so the error doesn't propagate to later decryptions
This commit is contained in:
@@ -272,10 +272,12 @@ OlmDecryption.prototype._decryptMessage = async function(
|
|||||||
// not a prekey message: we can safely just try & decrypt it
|
// not a prekey message: we can safely just try & decrypt it
|
||||||
return this._reallyDecryptMessage(theirDeviceIdentityKey, message);
|
return this._reallyDecryptMessage(theirDeviceIdentityKey, message);
|
||||||
} else {
|
} else {
|
||||||
this._olmDevice._olmPrekeyPromise = this._olmDevice._olmPrekeyPromise.then(() => {
|
const myPromise = this._olmDevice._olmPrekeyPromise.then(() => {
|
||||||
return this._reallyDecryptMessage(theirDeviceIdentityKey, message);
|
return this._reallyDecryptMessage(theirDeviceIdentityKey, message);
|
||||||
});
|
});
|
||||||
return await this._olmDevice._olmPrekeyPromise;
|
// we want the error, but don't propagate it to the next decryption
|
||||||
|
this._olmDevice._olmPrekeyPromise = myPromise.catch(() => {});
|
||||||
|
return await myPromise;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user