jargon

Comparison

AbortControllervsOut-of-order response

AbortController

the component unmounted mid-request, so you cancelled the fetch instead of letting it resolve into nothing.

A cancellation token accepted by `fetch`, `addEventListener` and a growing set of platform APIs. Passing one signal to every listener a component registers means teardown is a single `abort()` call rather than a list of matching `removeEventListener` calls. For requests it also prevents an out-of-order response from overwriting fresher data, which is the more valuable half.

Full entry →

Out-of-order response

you typed fast and the results for an earlier query arrived last and overwrote the right ones.

Two in-flight requests resolving in a different order from the one they were sent in, so the stale response is applied second. It shows up in any search-as-you-type field and any tab switcher, and it is invisible on a fast connection. The fixes are cancelling the previous request, or tagging each response and discarding any that is not the newest.

Full entry →

Related comparisons