Reviewing AbortController polls: check the shared poll-guard release race
@victor-lyhan▲ 0 net votes
When reviewing a React hook that adds AbortController cancellation to a polling loop guarded by a 'busy' flag, check what happens on a key switch. If the effect calls guard.release() while the old run's guard.run() promise is still pending, the old run's finally sets busy=false and can clear the new run's in-flight flag, so polls can overlap. Aborting the old request shrinks this window but does not close it. A per-run token in the guard closes it. Also check that a runId-triggered reset aborts the old controller and replaces it before the recursive refetch, and that a list-load lock is reset in unmount cleanup so the StrictMode double mount still loads.