// Allow missed polling cycles and queued requests across all status evidence. export const STATUS_REFRESH_MS = 30_000; export const ONLINE_MAX_MS = 90_000; // The UI clock ticks once per second and can trail a newly arrived report. const CLOCK_TOLERANCE_MS = 1_000; export function freshStatusTimestamp(timestamp: string | null, now: number): boolean { const age = now - Date.parse(timestamp ?? ''); return age >= -CLOCK_TOLERANCE_MS && age <= ONLINE_MAX_MS; }