Skip to content

Commit 42bd20e

Browse files
icecrasher321claude
andcommitted
docs(tools): record the measured Bun 1.3.14 timeout behavior
Replaces the inferred note with the numbers from a probe against the pinned runtime: no option dies at 300028ms, timeout:false survives 310031ms, and a numeric timeout is ignored. Also records that bun-types@1.3.14 does not declare the option even though the runtime honors it, which is why the interface is declared locally. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 3d10803 commit 42bd20e

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

apps/sim/lib/core/utils/fetch-deadline.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,22 @@
1919
* exactly the bug. Disarming leaves one enforcement point instead of two that
2020
* disagree.
2121
*
22-
* Note the pinned runtime accepts only the boolean/zero form. Bun 1.3.14
23-
* ignores a positive numeric `timeout` — verified against the pinned version by
24-
* observing that `{ timeout: 1000 }` does not abort a request that takes 3s to
25-
* answer — so passing the deadline as a number silently changes nothing. The
26-
* numeric idle-deadline form exists only on Bun's `main`. Do not "improve" this
27-
* to pass the deadline through until the pinned version supports it, and
28-
* re-verify with that probe if you do.
22+
* The pinned runtime accepts only the boolean/zero form. Measured on Bun 1.3.14
23+
* against a server that withholds response headers, so the numbers below are
24+
* the real deadline rather than an inferred one:
25+
*
26+
* no option -> THREW 300028ms (TimeoutError) <- the 300s default
27+
* timeout: false -> RESOLVED 310031ms <- disarmed
28+
* timeout: 1000 -> RESOLVED 3008ms on a 3s request <- numeric ignored
29+
*
30+
* So a positive numeric `timeout` silently changes nothing on this version; the
31+
* numeric idle-deadline form and `BUN_CONFIG_HTTP_IDLE_TIMEOUT` both exist only
32+
* on Bun's `main`. Do not "improve" this into a numeric pass-through until the
33+
* pinned version supports it, and re-measure with the probe above if you do.
34+
*
35+
* `bun-types@1.3.14` does not declare `timeout` on `BunFetchRequestInit` even
36+
* though the runtime honors the boolean form — the types lag the runtime, which
37+
* is why the interface below is declared locally rather than imported.
2938
*
3039
* Node's undici has no equivalent default and ignores the option, so this is
3140
* safe on both runtimes.

0 commit comments

Comments
 (0)