From 4ff0b9705c5511dd49cb09361c76c7f293cbd41a Mon Sep 17 00:00:00 2001 From: npeter83 Date: Mon, 15 Jun 2026 17:00:06 +0200 Subject: [PATCH] fix(header): keep the sync-status count live (focus refetch + background poll) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The header 'N without full history' (and sync state) polled every 30s but only while the tab was focused, and the global refetchOnWindowFocus is off — so after switching tabs the count looked frozen until a manual reload. Poll in the background too and refetch on focus so it tracks the scheduler's progress without F5. --- frontend/src/components/SyncStatus.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/components/SyncStatus.tsx b/frontend/src/components/SyncStatus.tsx index 2e5c368..0175365 100644 --- a/frontend/src/components/SyncStatus.tsx +++ b/frontend/src/components/SyncStatus.tsx @@ -20,7 +20,12 @@ export default function SyncStatus({ const { data } = useQuery({ queryKey: ["my-status"], queryFn: api.myStatus, + // Track the scheduler near-real-time: poll even when the tab is backgrounded, and + // refresh immediately on tab focus (the global default disables focus refetch), so the + // "N without full history" count keeps ticking down without a manual reload. refetchInterval: 30_000, + refetchIntervalInBackground: true, + refetchOnWindowFocus: true, staleTime: 25_000, });