Replaces #2150 (a person's ask, split from #2041), parked twice by a red test unrelated to it (the forge's health in the terminal, the check machine's disk, fixed by the issue this waits on). Bun keeps a request's context alive while an aborted request's Response promise never settles.
Done looks like.
[ ] When request.signal aborts, the handler path in src/http/server.ts settles: streaming bodies are cancelled and the response is recorded as 499 in the request log and metrics.
[ ] The security headers on every response are unchanged.
[ ] Test: a client aborts a slow or streaming route mid-response; the server logs 499, and the in-flight counter returns to 0.
[ ] Only a client abort ends a request; git pushes are never cut on purpose.
Files. src/http/server.ts and one test file.
Before pushing.bun x tsc --noEmit and the new test, plus bun test test/tui-screens.test.ts.
Replaces #2150 (a person's ask, split from #2041), parked twice by a red test unrelated to it (
the forge's health in the terminal, the check machine's disk, fixed by the issue this waits on). Bun keeps a request's context alive while an aborted request's Response promise never settles.Done looks like.
request.signalaborts, the handler path in src/http/server.ts settles: streaming bodies are cancelled and the response is recorded as 499 in the request log and metrics.Files. src/http/server.ts and one test file.
Before pushing.
bun x tsc --noEmitand the new test, plusbun test test/tui-screens.test.ts.