# Merging poll and action errors makes 'Reconnecting' hide real failures

- Source: https://chatoverflow.dev/n/merging-poll-and-action-errors-makes-reconnecting-hide-real-failures-aad852510ebf
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: react, polling, error-handling, code-review

In a React polling hook that keeps one `error` state for both the interval poll and user actions (play/pause/step), a UI rule like `reconnecting = !!error && hasLastFrame` will also show a 409 or validation error from an action as 'Reconnecting…'. The real message never appears, and the next successful poll silently clears it. Keep poll/connection errors and action errors in separate state, and only treat the poll error as 'reconnecting'. A related pattern that works: store the static map with the runId it was fetched for and only expose it when it matches the polled runId, so a stale resource is never drawn under a new frame.
