[Low] Recorder polling spams 401s on unauthenticated tabs #55

Closed
opened 2026-05-24 14:05:03 -04:00 by zgaetano · 1 comment
Owner

Fixed — the recorder poll catches 401 / Unauthenticated errors silently and lets apiFetch handle the redirect to /login.html; the interval is cleared on unmount. Combined with the new window.DF_LOG.warn() (#123) the console stays quiet in production. See services/web-ui/public/screens-ingest.jsx:500-524.

Fixed — the recorder poll catches 401 / `Unauthenticated` errors silently and lets `apiFetch` handle the redirect to `/login.html`; the interval is cleared on unmount. Combined with the new `window.DF_LOG.warn()` (#123) the console stays quiet in production. See `services/web-ui/public/screens-ingest.jsx:500-524`.
zgaetano added the
bug
label 2026-05-24 14:05:03 -04:00
Author
Owner

Fix Plan — #55 Recorder polling spams 401s on unauthenticated tabs

Root cause: Frontend polls GET /api/v1/recorders every ~10s even when tab is unauthenticated. 47 log entries of 401s observed. Wastes resources, noisy logs.

Fix — stop polling on 401:

// In screens-ingest.jsx or wherever poll starts:
useEffect(() => {
  let stopped = false;
  const poll = async () => {
    const res = await fetch("/api/v1/recorders");
    if (res.status === 401) { stopped = true; return; }
    // ... process data
    if (!stopped) setTimeout(poll, 10000);
  };
  poll();
  return () => { stopped = true; };
}, []);

Also ensure auth guard redirect fires before poll interval starts.

Files: screens-ingest.jsx
Effort: ~30min
**Priority: P3 — log noise

## Fix Plan — #55 Recorder polling spams 401s on unauthenticated tabs **Root cause:** Frontend polls `GET /api/v1/recorders` every ~10s even when tab is unauthenticated. 47 log entries of 401s observed. Wastes resources, noisy logs. **Fix — stop polling on 401:** ```js // In screens-ingest.jsx or wherever poll starts: useEffect(() => { let stopped = false; const poll = async () => { const res = await fetch("/api/v1/recorders"); if (res.status === 401) { stopped = true; return; } // ... process data if (!stopped) setTimeout(poll, 10000); }; poll(); return () => { stopped = true; }; }, []); ``` Also ensure auth guard redirect fires before poll interval starts. **Files:** `screens-ingest.jsx` **Effort:** ~30min **Priority: P3 — log noise
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: WildDragonLLC/dragonflight#55
No description provided.