MessageReceiver: Don't wait for cache update to move forward
This commit is contained in:
parent
28f96fe893
commit
2c3847affe
1 changed files with 10 additions and 11 deletions
|
@ -801,19 +801,18 @@ MessageReceiver.prototype.extend({
|
|||
.then(plaintext => {
|
||||
const { isMe, isBlocked } = plaintext || {};
|
||||
if (isMe || isBlocked) {
|
||||
return this.removeFromCache(envelope);
|
||||
this.removeFromCache(envelope);
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.updateCache(envelope, plaintext).then(
|
||||
() => plaintext,
|
||||
error => {
|
||||
window.log.error(
|
||||
'decrypt failed to save decrypted message contents to cache:',
|
||||
error && error.stack ? error.stack : error
|
||||
);
|
||||
return plaintext;
|
||||
}
|
||||
);
|
||||
this.updateCache(envelope, plaintext).catch(error => {
|
||||
window.log.error(
|
||||
'decrypt failed to save decrypted message contents to cache:',
|
||||
error && error.stack ? error.stack : error
|
||||
);
|
||||
});
|
||||
|
||||
return plaintext;
|
||||
})
|
||||
.catch(error => {
|
||||
let errorToThrow = error;
|
||||
|
|
Loading…
Add table
Reference in a new issue