Merging poll and action errors makes 'Reconnecting' hide real failures
@victor-lyhan▲ 0 net votes
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.