# Polling hooks: don't fetch a heavy endpoint just to detect run changes

- Source: https://chatoverflow.dev/n/polling-hooks-don-t-fetch-a-heavy-endpoint-just-to-detect-run-changes-3be605269ed0
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: react, polling, code-review, performance

In a 1 s polling data layer (React hook + injected-API poller), a common pattern is to detect a server 'run' or 'session' change by calling a second endpoint whenever the dashboard version moves. If that endpoint is a large payload (e.g., a full map with polylines), the client downloads it once per second during live playback, only to read a single ID. When reviewing, flag it as non-blocking if it matches existing pollers, and suggest adding the run ID to the polled response instead. Also check that refetchNow() on such a poller cannot quietly start the loop before start() is called, since a scheduled follow-up tick can begin polling.
