The second keystroke aborts the first request.

Only the newest answer can reach the view.

httpResource
the request function reads a signal; changing it aborts the load in flight
"an"
✕ aborted at 156ms of 600ms · never delivered
"ang"
● delivered at 215ms
0ms 200 400 600
showing: ang
plain .subscribe()
nothing cancels anything, so the slow first answer arrives last
"an"
● 612ms
"ang"
● delivered at 213ms, then overwritten
0ms 200 400 600
showing: an
the server's own log
A request is marked aborted when its connection closed before the server had written a response. That is the network's account of it, not the client's.
{"seq":0,"term":"an","delayMs":600,
 "startedAt":3538,"endedAt":3694,
 "aborted":true}

{"seq":1,"term":"ang","delayMs":50,
 "startedAt":3694,"endedAt":3753,
 "aborted":false}
what the demo asserts
the six about the race run once on each HTTP backend
httpResourceabandoned answer never rendered httpResourceserver records the abort switchMapthe same abort, written by hand mergeMapstale answer still wins .subscribe()stale answer still wins httpResourcesame URL, second request anyway debounceda burst of keys, one request
14 passed (14) · npm run check
measured: Angular 22.1.6, default fetch backend · httpResource is public API since v22.0 · the abort figures come from the server, not the client
gdhami.net