From d2d2a418ebf2247b3406af36ddee04fdb2a699aa Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 8 Feb 2023 16:00:10 +1100 Subject: [PATCH] fix: use envelope time when dont have msg request response timestamp --- ts/receiver/contentMessage.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ts/receiver/contentMessage.ts b/ts/receiver/contentMessage.ts index ff29d76a3..aa8dc813a 100644 --- a/ts/receiver/contentMessage.ts +++ b/ts/receiver/contentMessage.ts @@ -626,11 +626,9 @@ async function handleMessageRequestResponse( unblindedConvoId, ConversationTypeEnum.PRIVATE ); - let mostRecentActiveAt = - Math.max(...compact(convosToMerge.map(m => m.get('active_at')))) || Date.now(); - - if (!isFinite(mostRecentActiveAt)) { - mostRecentActiveAt = Date.now(); + let mostRecentActiveAt = Math.max(...compact(convosToMerge.map(m => m.get('active_at')))); + if (!isFinite(mostRecentActiveAt) || mostRecentActiveAt <= 0) { + mostRecentActiveAt = toNumber(envelope.timestamp); } conversationToApprove.set({