Don't treat TimeoutError as a decryption error

This commit is contained in:
Fedor Indutny 2021-11-30 20:34:05 +01:00 committed by GitHub
parent 348012ef4c
commit 77924918df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1570,21 +1570,24 @@ export default class MessageReceiver
const uuid = envelope.sourceUuid; const uuid = envelope.sourceUuid;
const deviceId = envelope.sourceDevice; const deviceId = envelope.sourceDevice;
// We don't do anything if it's just a duplicated message // Job timed out, not a decryption error
if ( if (
error?.message?.includes && error?.name === 'TimeoutError' ||
error.message.includes('message with old counter') error?.message?.includes?.('task did not complete in time')
) { ) {
this.removeFromCache(envelope); this.removeFromCache(envelope);
throw error; throw error;
} }
// We don't do anything if it's just a duplicated message
if (error?.message?.includes?.('message with old counter')) {
this.removeFromCache(envelope);
throw error;
}
// We don't do a light session reset if it's an error with the sealed sender // We don't do a light session reset if it's an error with the sealed sender
// wrapper, since we don't trust the sender information. // wrapper, since we don't trust the sender information.
if ( if (error?.message?.includes?.('trust root validation failed')) {
error?.message?.includes &&
error.message.includes('trust root validation failed')
) {
this.removeFromCache(envelope); this.removeFromCache(envelope);
throw error; throw error;
} }