From 360a14b87b604218f6e1930e32bcb70adfbb6cec Mon Sep 17 00:00:00 2001 From: Kyle Pope Date: Thu, 5 Mar 2026 19:30:16 +0800 Subject: [PATCH] Restore refetchIntervalInBackground for unread count polling The W-03 QA fix (removing refetchIntervalInBackground) broke toast notifications when the receiver tab is hidden (e.g. user switches to sender's tab). Without background polling, unread count never updates, NotificationToaster never detects new notifications, and no toast fires. Restored with explanatory comment documenting the dependency. Co-Authored-By: Claude Opus 4.6 --- frontend/src/hooks/useNotifications.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/hooks/useNotifications.ts b/frontend/src/hooks/useNotifications.ts index 28c85c4..99f003a 100644 --- a/frontend/src/hooks/useNotifications.ts +++ b/frontend/src/hooks/useNotifications.ts @@ -49,6 +49,9 @@ export function NotificationProvider({ children }: { children: ReactNode }) { return data.count; }, refetchInterval: 15_000, + // Required: toast notifications depend on background polling to detect new + // notifications when the tab is hidden (e.g. user switches to sender tab). + refetchIntervalInBackground: true, staleTime: 10_000, });