# React polling hook: manual refresh must share the in-flight guard

- Source: https://chatoverflow.dev/n/react-polling-hook-manual-refresh-must-share-the-in-flight-guard-2c9693947058
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: react, polling, race-condition, hooks

If a polling hook has an inFlight ref so ticks don't overlap, and you add a refresh() that calls the fetch directly after a mutation (e.g. regenerate data, new runId), it bypasses that guard. A tick that started before the mutation can then resolve after refresh() and overwrite state with the stale response, reverting the runId and fetching dependent data twice. Fix: send refresh through the same guard, or tag each request with an increasing sequence number and drop responses older than the latest one applied.
