From e9aa30f5bff6300794b2551b9ff99035f2253f16 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Thu, 15 Jun 2023 18:48:50 -0700 Subject: [PATCH] Do not optimistically set active_at & timestamp when sending edit --- ts/models/conversations.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts index 8e137af57..830dc8d0d 100644 --- a/ts/models/conversations.ts +++ b/ts/models/conversations.ts @@ -3791,14 +3791,18 @@ export class ConversationModel extends window.Backbone lastMessageStatus: 'sending' as const, }; + const isEditMessage = Boolean(message.get('editHistory')); + this.set({ ...draftProperties, ...(enabledProfileSharing ? { profileSharing: true } : {}), ...(dontAddMessage ? {} : this.incrementSentMessageCount({ dry: true })), - active_at: now, - timestamp: now, + // If it's an edit message we don't want to optimistically set the + // active_at & timestamp to now. We want it to stay the same. + active_at: isEditMessage ? this.get('active_at') : now, + timestamp: isEditMessage ? this.get('timestamp') : now, ...(unarchivedConversation ? { isArchived: false } : {}), });