Perform a legacy session reset if you fail to decrypt a sync message.

This commit is contained in:
Greyson Parrelli 2023-08-10 17:16:26 -04:00 committed by Cody Henthorne
parent 5688d85789
commit 72e5532c6c

View file

@ -271,6 +271,16 @@ object MessageDecryptor {
val receivedTimestamp: Long = System.currentTimeMillis()
val sender: Recipient = Recipient.external(context, protocolException.sender)
if (sender.isSelf) {
Log.w(TAG, "${logPrefix(envelope)} Decryption error for a sync message! Enqueuing a session reset job.")
followUpOperations += FollowUpOperation {
AutomaticSessionResetJob(sender.id, senderDevice, envelope.timestamp)
}
return Result.Ignore(envelope, serverDeliveredTimestamp, followUpOperations)
}
followUpOperations += FollowUpOperation {
buildSendRetryReceiptJob(envelope, protocolException, sender)
}