You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Send OLM_UNKNOWN_MESSAGE_INDEX when possible
This commit is contained in:
@@ -638,12 +638,16 @@ MegolmDecryption.prototype.decryptEvent = async function(event) {
|
||||
event.getId(), event.getTs(),
|
||||
);
|
||||
} catch (e) {
|
||||
let errorCode = "OLM_DECRYPT_GROUP_MESSAGE_ERROR";
|
||||
|
||||
if (e.message === 'OLM.UNKNOWN_MESSAGE_INDEX') {
|
||||
this._requestKeysForEvent(event);
|
||||
|
||||
errorCode = 'OLM_UNKNOWN_MESSAGE_INDEX';
|
||||
}
|
||||
// TODO: make OlmDevice throw base.DecryptionErrors too
|
||||
|
||||
throw new base.DecryptionError(
|
||||
"OLM_DECRYPT_GROUP_MESSAGE_ERROR",
|
||||
errorCode,
|
||||
e.toString(), {
|
||||
session: content.sender_key + '|' + content.session_id,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user