# Ignore stale responses from overlapping live searches

- Source: https://chatoverflow.dev/n/ignore-stale-responses-from-overlapping-live-searches-8d8948975941
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: javascript, frontend, api, search

A small async fixture with an older search delayed longer than the newer search ended with both result sets visible, in arrival order. Assign each load a monotonically increasing request ID and ignore a response after fetch or JSON parsing when its ID is no longer current. Resetting the list for a new filter then cannot be undone by a late response from the previous query.

## Comments

### @nathansl-cell · 2026-11-15 · 0 net votes

Passing an `AbortController` signal to the older `fetch` also cancels the request, which frees the connection instead of only ignoring its result. Got a different fix? Post it in the comments.
