---
title: "Search shows results for an earlier query: prove the responses arrived out of order | Proofline"
description: "When a search box shows results for an earlier query, the page probably displayed the last response to arrive instead of the one for the latest query."
url: https://proofline.sh/learn/stale-search-results-race/
---

[Learning center](/learn/)

# Search shows results for an earlier query: prove the responses arrived out of order

When a search box shows results for an earlier query, the page probably displayed the last response to arrive instead of the one for the latest query. The Network panel's waterfall shows whether the responses crossed, and their payloads show which one the page displayed.

Network outages The Proofline team November 20, 2026 4 min read

## Two causes that show the same screen

|  | Cause A: responses arrived out of order | Cause B: the server answered the latest query wrongly |
| --- | --- | --- |
| Waterfall | An earlier query's request finishes after the latest query's request | Any order: crossed responses do no harm when the page ignores stale ones |
| The results on screen | Match an earlier request's response | Match the latest request's response |
| The latest request's response | Correct results for the latest query | Results that do not match its query |
| Typing speed | Appears when typing quickly, rarely when typing slowly | Appears however the query is entered |
| Where the fix goes | The page: ignore or cancel stale responses | The search service |

The deciding observation is which response the displayed results came from, together with whether the latest response was correct. Crossed finish times in the waterfall make Cause A possible; they do not establish it, because the same crossing appears in a page that ignores stale responses while the server answers the latest query wrongly.

## Reproduced in Chromium

A local search page fetched `/search?q=…` on every keystroke and wrote each response into the results list. The test server answered `ap` after 900 milliseconds and `app` after 50 milliseconds, imitating a slow and a fast query. Typing `app` produced:

```
GET /search?q=a      started 0 ms     finished ~10 ms
GET /search?q=ap     started ~100 ms  finished ~1000 ms
GET /search?q=app    started ~200 ms  finished ~250 ms

input: app
shown: ap-1, ap-2
```

The times are approximate: they follow from the 100-millisecond typing delay and the server's configured delays. The `app` response arrived first and was displayed, then the slower `ap` response arrived and replaced it. The box says `app`; the list shows `ap-1, ap-2`, which is the `ap` response's payload. The `app` response held the correct results for `app`, which rules out Cause B.

## Record the ordering

1.  Open the Network panel and filter for the search endpoint.
2.  Type the query at the speed that produces the bug.
3.  Look at the **Waterfall** column. Hover a bar to see when the request was queued, started and finished. [Network timing phases](https://developer.chrome.com/docs/devtools/network/reference)
4.  Select each request and read its **Payload** for the query and **Response** for the results.

A screenshot of the waterfall with the request URLs visible shows the crossing, but not which response the page displayed. Add the query and the first result of each response in text, and the results on screen, so the receiver can match them.

If you cannot reproduce by typing, use the Network panel's throttling to slow every request. Slower requests widen the window in which responses can cross. [Network throttling](https://developer.chrome.com/docs/devtools/network/reference)

## Worked example: a customer lookup that shows the wrong account

This example is fictional. A support agent types a customer's email address into a lookup box and sometimes opens the wrong account. The box shows `dana@example.test`; the account card belongs to `dan@example.test`.

The waterfall showed one lookup per character. The request for `dan` took 1.2 seconds because it matched many accounts; the agent finished typing the rest of the address within a second, and the request for the full address took 80 milliseconds. The `dan` response finished last. Its response listed `dan@example.test` first, and the page opened that account. The full address's response listed `dana@example.test`, so the server had answered the latest query correctly.

The report said: _the lookup sends one request per keystroke and renders whichever response arrives last. A slow prefix query can finish after the full address and replace its result. In this recording, `dan` finished about 0.3 seconds after `dana@example.test`._ That meant an agent could act on the wrong customer's account.

## The usual fixes

The page can cancel the previous request when a new one starts, using an `AbortController`, or can tag each request and ignore any response that is not for the current query. Debouncing the input reduces the number of requests but does not prevent a slow one from finishing last. [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) · [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)

When cancellation is in place, the Network panel shows the superseded requests as `(canceled)`, which is expected. See [requests with no status](/learn/failed-request-no-status/).

## What to put in the report

-   The query in the box and the query the results belong to.
-   The start and finish times of each request, or a waterfall screenshot with URLs.
-   The response the displayed results match.
-   The latest request's response, to show whether it was correct.
-   How fast you typed, and whether throttling was on.

## Questions

### Is this only a search box problem?

No. Any view that refreshes from requests started by user input can show it: filters, tabs that load data, pagination, and autosave status. The test is the same: compare start order with finish order, then match what is on screen to a response.

### The server is fast. Can this still happen?

Yes. Caches, network conditions and query cost vary per request. A single slow response is enough, which is why the bug often appears only for some users or some queries.

### Can a service worker or cache cause it?

A cache can make the later request finish faster than the earlier one, which creates the same crossing. When the screen still matches the earlier response, the fix belongs in the page.

Return to the [method for browser bug reports](/learn/browser-bug-report-evidence/) for the other symptoms in this collection.

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [Turn a browser symptom into a bug report another engineer can act on](/learn/browser-bug-report-evidence/)
    
    Network outages The Proofline team November 20, 2026 7 min read
    
-   ### [One click, two orders: show whether the browser sent two requests](/learn/duplicate-submit-double-click/)
    
    Network outages The Proofline team November 20, 2026 4 min read
