Inspiration

Self-hosted Postgres pools dying under transient connection failures, and browser bundles behaving differently from Node. Both are silent production bugs, the kind you only find by reading the code path, not the docs.

What it does

Two open-source fixes, both live as pull requests:

  1. Drizzle ORM (drizzle-team/drizzle-orm#6348). node-postgres transaction() ran BEGIN outside try/finally, so every failed BEGIN leaked one pool client. A few dead sockets exhausted the whole pool. The fix moves BEGIN inside try and routes rollback failures to release(err) so pg-pool destroys dead clients instead of recycling them.

  2. Bun (oven-sh/bun#43876). The browser Buffer polyfill diverged from Node in indexOf / lastIndexOf / includes for empty values, Uint8Array values, and the end argument, and thrown errors had no codes. Reworked to Node v26 semantics, verified with a 24,800-combo differential run against Node plus a 356,000-call sweep against an independent model oracle.

How I built it

Read the issue, reproduced against the real code (Node for the polyfill, mocked pool clients for the transaction path), minimal diff, regression tests that fail pre-fix and pass post-fix, full neighboring suites green.

Challenges

The Bun fix shares one function with a sibling open PR (#43654). I diffed both and proved they compose instead of colliding. The Drizzle fix had to preserve exact error semantics so callers see the same wrapped errors as before.

What's next

Shepherd both PRs through review and port the transaction pattern to the sibling drivers.

Share this project:

Updates

Submission history