Does the UI ever show old results after the user types a newer query?
The original implementation failed the “Older response arrives last” check. Expected 2 and observed 1. The corrected implementation met both expectations on the same inputs.
What the control case missed
With responses delivered in request order the last response is correct. When request 2 completes before request 1, a last-arrival-wins handler replaces the user's current result with older data.
| Check | Expected | Original | Corrected |
|---|---|---|---|
| Responses arrive in order | 2 | 2 | 2 |
| Older response arrives last | 2 | 1 | 2 |
What to check before merging
Track the active request when applying UI updates. Repeat the case with cancellation, errors and a cleared query. The fixture models response ordering without relying on an unreliable network delay.
Reproduce the recorded result
Download the Node.js fixture and run node run.mjs stale-search-results with Node.js 24. Compare the printed JSON with the recorded results. This is a locally executed model of the regression, using synthetic inputs. It covers the rule shown here. Hosted runs, browser behaviour and customer PRs require their own evidence.