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 <noreply@anthropic.com>
This commit is contained in:
@@ -308,6 +308,8 @@ async function refetchAllCrmQueries() {
|
|||||||
refetchFeed(),
|
refetchFeed(),
|
||||||
refetchPins(),
|
refetchPins(),
|
||||||
refetchDocuments(),
|
refetchDocuments(),
|
||||||
|
refetchChatMessages(),
|
||||||
|
refetchChatConversations(),
|
||||||
]);
|
]);
|
||||||
await refreshSelectedClientTimeline();
|
await refreshSelectedClientTimeline();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -619,7 +619,7 @@ export function usePilotChat(opts: {
|
|||||||
pilotBackgroundPoll = setInterval(() => {
|
pilotBackgroundPoll = setInterval(() => {
|
||||||
if (!opts.authMe.value) return;
|
if (!opts.authMe.value) return;
|
||||||
loadPilotMessages().catch(() => {});
|
loadPilotMessages().catch(() => {});
|
||||||
}, 2000);
|
}, 30_000);
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopPilotBackgroundPolling() {
|
function stopPilotBackgroundPolling() {
|
||||||
|
|||||||
Reference in New Issue
Block a user