From 933a3bd5ff0586c972889b3559179facc3c54dff Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 11 Mar 2025 12:27:45 +0530 Subject: [PATCH] feat: log only out of sync updated_at --- .../dashboard/store/modules/conversations/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/javascript/dashboard/store/modules/conversations/index.js b/app/javascript/dashboard/store/modules/conversations/index.js index 520421ae6..8a900c9fa 100644 --- a/app/javascript/dashboard/store/modules/conversations/index.js +++ b/app/javascript/dashboard/store/modules/conversations/index.js @@ -216,7 +216,7 @@ export const mutations = { const selectedConversation = allConversations[index]; // ignore out of order events - if (conversation.updated_at <= selectedConversation.updated_at) { + if (conversation.updated_at < selectedConversation.updated_at) { Sentry.withScope(scope => { scope.setContext('incoming', conversation); scope.setContext('stored', selectedConversation); @@ -226,6 +226,10 @@ export const mutations = { return; } + if (conversation.updated_at === selectedConversation.updated_at) { + return; + } + const { messages, ...updates } = conversation; allConversations[index] = { ...selectedConversation, ...updates }; if (_state.selectedChatId === conversation.id) {