From 195df8e16a8e29a299a1530866e6a51d853a1aba Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Tue, 24 Feb 2026 15:41:58 +0700 Subject: [PATCH] fix: stop aggressive 2s chat polling, use WebSocket instead - Add refetchChatMessages + refetchChatConversations to refetchAllCrmQueries so WebSocket dashboard.changed events cover pilot chat updates - Reduce background polling from 2s to 30s (fallback only) Co-Authored-By: Claude Opus 4.6 --- frontend/app/components/workspace/CrmWorkspaceApp.vue | 2 ++ frontend/app/composables/usePilotChat.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/app/components/workspace/CrmWorkspaceApp.vue b/frontend/app/components/workspace/CrmWorkspaceApp.vue index 8635202..7d20a56 100644 --- a/frontend/app/components/workspace/CrmWorkspaceApp.vue +++ b/frontend/app/components/workspace/CrmWorkspaceApp.vue @@ -308,6 +308,8 @@ async function refetchAllCrmQueries() { refetchFeed(), refetchPins(), refetchDocuments(), + refetchChatMessages(), + refetchChatConversations(), ]); await refreshSelectedClientTimeline(); } diff --git a/frontend/app/composables/usePilotChat.ts b/frontend/app/composables/usePilotChat.ts index 28a495b..69a1576 100644 --- a/frontend/app/composables/usePilotChat.ts +++ b/frontend/app/composables/usePilotChat.ts @@ -619,7 +619,7 @@ export function usePilotChat(opts: { pilotBackgroundPoll = setInterval(() => { if (!opts.authMe.value) return; loadPilotMessages().catch(() => {}); - }, 2000); + }, 30_000); } function stopPilotBackgroundPolling() {