Fix handling of encrypted unprocessed envelopes

This commit is contained in:
Fedor Indutny
2025-02-10 12:44:59 -08:00
committed by GitHub
parent 0d87e3e6c9
commit 5bdb39a95b
7 changed files with 73 additions and 23 deletions

View File

@@ -874,9 +874,8 @@ export default class MessageReceiver
const envelope: ProcessedEnvelope = {
id: item.id,
receivedAtCounter: item.receivedAtCounter ?? item.timestamp,
receivedAtDate:
item.receivedAtCounter == null ? Date.now() : item.timestamp,
receivedAtCounter: item.receivedAtCounter,
receivedAtDate: item.receivedAtDate,
messageAgeSec: item.messageAgeSec,
// Proto.Envelope fields
@@ -1189,11 +1188,8 @@ export default class MessageReceiver
sourceServiceId: envelope.sourceServiceId,
sourceDevice: envelope.sourceDevice,
destinationServiceId: envelope.destinationServiceId,
// This field is only used for aging items out of the cache. The original
// envelope's timestamp will be used when retrying this item.
timestamp: envelope.receivedAtDate,
timestamp: envelope.timestamp,
receivedAtDate: envelope.receivedAtDate,
attempts: 0,
isEncrypted: true,
content: envelope.content,