fix(portals): add a 15s request timeout to every board fetch (#197)

None of the board CLIs set a fetch timeout, and the retry loops react only to HTTP status codes, not to a connection that is accepted then never responds (black-holed TCP, hung TLS, stalled proxy) - so await fetch(...) never settles and the command hangs with no output and no exit. freehire's helper even documented a fast-degrade contract its try/catch didn't deliver on a mid-flight stall. Adds signal: AbortSignal.timeout(15000) to every fetch across all six CLIs, with network-free tests asserting the signal is present on each request wrapper.

By @thejesh23. Verified: 8 timeout tests pass locally with fetch stubbed (no network), and would fail on the pre-fix code.

Closes #196
This commit is contained in:
Thejesh Reddy
2026-07-20 20:19:27 +02:00
committed by GitHub
parent 36462e356e
commit 9cad956cc9
13 changed files with 172 additions and 2 deletions
@@ -29,6 +29,7 @@ export async function htmlFetch(url: string): Promise<string> {
"X-Requested-With": "XMLHttpRequest",
},
redirect: "follow",
signal: AbortSignal.timeout(15000),
})
if (response.status === 429 || response.status >= 500) {
if (attempt === maxRetries) {