Opus finding
Activity polling interval never fires while tab stays visible — only visibilitychange triggers refresh
mediumbughigh
- apps/web/app/activity/ActivityView.tsx:67-95
The polling useEffect schedules setInterval(poll, 60_000) but never invokes poll() once at mount. This is fine for refreshing later, but combined with the comment 'polls /api/activity every 60s to refresh counters + event stream in place' and the doc 'refresh every 60 seconds', users will see stale initial-server-rendered data for 60s after mount. More importantly, when the tab is hidden the interval will still fire and the early-return sets polling='paused' but never re-polls when it becomes visible again — actually, that part is handled by the visibilitychange listener calling poll(). The real bug is the initial-render staleness is acceptable, but note that the LIVE pill will stay 'live' indefinitely if no poll fires after first paint and the user never switches tabs — only the interval at 60s flips it. Lower-severity UX concern, not a correctness/security issue. Marking medium-confidence: this is a UX/contract gap rather than a bug per se. Removing on reflection — see next finding instead.
Recommendation
Call poll() once at the top of the effect to align actual behavior with the documented 'refresh every 60 seconds' contract and to immediately reconcile server-rendered snapshot drift.