Changelog

oven-sh/bun · · 34 commits

Bun lands major compatibility and correctness wave

Worker threads, fetch, spawn, SQL, TLS, and file/path handling all got substantive fixes, plus a large C API cleanup and timer overhaul.

Worker threads compatibility jumps by 48 passing tests (cirospaciariab84aa2)

Bun ports Node’s worker_threads messaging machinery, adding support for postMessageToThread, richer MessagePort semantics, shared environment handling, inspector hooks, and better exit/error/transfer behavior. The commit substantially expands Node compatibility in an area that touches worker lifecycle and cross-thread messaging.

TLS and socket connection behavior now matches Node more closely (robobunc1076ce)

This fixes multiple client-side TLS edge cases, including certificate verification and socket-wrapping paths that previously leaked or mis-handled plaintext data on untrusted chains. It’s a broad compatibility and security-relevant change for outbound connections.

fetch() now decodes concatenated gzip members fully (robobun4f94391)

Responses with Content-Encoding: gzip no longer stop after the first gzip member; Bun now continues through multi-member streams like cat a.gz b.gz, pigz, and BGZF-style payloads. That prevents silent truncation of real-world compressed responses.

Bun.serve fixes HTTP method and cache-validator edge cases (robobun593ec74, robobunc56430c, robobun49a3ca8, robobun3da0963)

Several server paths now behave correctly for HEAD, If-None-Match, and If-Modified-Since, avoiding protocol violations and stale-cache bugs. The streaming-response abort path also now handles peer disconnects without surfacing the wrong failure mode.

Spawn handling gets a cluster of correctness fixes (robobunb330399, robobun4880f0a, robobun2c12b16, robobuneec0425, robobun282b94c, robobun65aa83b)

Bun now avoids double-closing exposed stdio fds, rejects NUL bytes in argv0/cwd, drains piped sync stdio through EOF, preserves inherited cwd behavior, fixes a Windows spawnSync timeout regression, and keeps terminal-attached subprocess output from being lost on POSIX. Together these close several correctness holes in process spawning.

SQL gains safer pipelining and numeric decoding (robobun7445e63, robobun70f6679)

Postgres query queuing now tracks pending writes so a later prepared statement can’t leapfrog an earlier queued request, preventing response mixups and pipeline wedges. Numeric float decoding also now sanitizes NaN boxing from binary wire results, removing a memory-safety class of bug.

Windows path resolution and filesystem behavior improve (dylan-conwayc773f88, robobun5d024c5)

Windows openat now builds NT-native object names from device paths instead of DOS-style paths, which should make dirfd-relative file operations more reliable. Separately, mkdtemp now honors its encoding option, matching Node’s return-type and encoding behavior.

WebStreams and timer internals see major refactors and fixes (sosukesuzuki5496119, robobun6bb5135, robobunf6e084f, robobuneead6e8)

A large WebStreams cleanup fixes several crash, hang, and data-loss issues in the C++ streams rewrite, while timer/event-loop changes move POSIX away from expensive us_timer_t usage and address fake-timer heap spinning. The sourcemap finalization fix also corrects mapping order/columns for minified bundles.

Rust/JSC cleanup removes legacy C-API usage (robobun86caf6e)

Bun deletes the Rust-side JavaScriptCore C API bridge and rewires call sites onto native bindings and JSValue methods. This is a major internal refactor that reduces API surface and should make the engine codebase easier to maintain.

Other misc changes

  • DNS pending-cache leak fix in HiveArray (robobun4643931)
  • Docker test images optimized to avoid healthcheck wedges (robobun90f8746)
  • net.connect({ localPort }) now sets SO_REUSEADDR on Unix (robobunc91d7da)
  • Re-export/cleanup pass across repo internals and build files (robobun91675d0)
  • Gitignore adds heap snapshots, profiler output, and core dumps (Jarred-Sumner5f145d6)
  • Windows timeout/leak test stabilization and related harness tweaks (robobuned4a810, robobun095eb31)