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
restore the order of backup vs retry decryption
This commit is contained in:
@@ -938,19 +938,6 @@ MegolmDecryption.prototype.onRoomKeyEvent = function(event) {
|
|||||||
content.session_key, keysClaimed,
|
content.session_key, keysClaimed,
|
||||||
exportFormat,
|
exportFormat,
|
||||||
).then(() => {
|
).then(() => {
|
||||||
if (this._crypto.backupInfo) {
|
|
||||||
// don't wait for the keys to be backed up for the server
|
|
||||||
this._crypto.backupGroupSession(
|
|
||||||
content.room_id, senderKey, forwardingKeyChain,
|
|
||||||
content.session_id, content.session_key, keysClaimed,
|
|
||||||
exportFormat,
|
|
||||||
).catch((e) => {
|
|
||||||
// This throws if the upload failed, but this is fine
|
|
||||||
// since it will have written it to the db and will retry.
|
|
||||||
console.log("Failed to back up group session", e);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).then(() => {
|
|
||||||
// have another go at decrypting events sent with this session.
|
// have another go at decrypting events sent with this session.
|
||||||
this._retryDecryption(senderKey, sessionId)
|
this._retryDecryption(senderKey, sessionId)
|
||||||
.then((success) => {
|
.then((success) => {
|
||||||
@@ -968,6 +955,19 @@ MegolmDecryption.prototype.onRoomKeyEvent = function(event) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}).then(() => {
|
||||||
|
if (this._crypto.backupInfo) {
|
||||||
|
// don't wait for the keys to be backed up for the server
|
||||||
|
this._crypto.backupGroupSession(
|
||||||
|
content.room_id, senderKey, forwardingKeyChain,
|
||||||
|
content.session_id, content.session_key, keysClaimed,
|
||||||
|
exportFormat,
|
||||||
|
).catch((e) => {
|
||||||
|
// This throws if the upload failed, but this is fine
|
||||||
|
// since it will have written it to the db and will retry.
|
||||||
|
console.log("Failed to back up group session", e);
|
||||||
|
});
|
||||||
|
}
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
logger.error(`Error handling m.room_key_event: ${e}`);
|
logger.error(`Error handling m.room_key_event: ${e}`);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user