Skip to content

presets(bun): restore idle timeout environment variable#4423

Open
b-mounir-dev wants to merge 1 commit into
nitrojs:mainfrom
b-mounir-dev:fix/bun-idle-timeout
Open

presets(bun): restore idle timeout environment variable#4423
b-mounir-dev wants to merge 1 commit into
nitrojs:mainfrom
b-mounir-dev:fix/bun-idle-timeout

Conversation

@b-mounir-dev

Copy link
Copy Markdown

Restores NITRO_BUN_IDLE_TIMEOUT support for the Bun preset after it was lost during the move to srvx.

Values from 0 to 255 are forwarded to Bun.serve, including 0 to disable the timeout. Invalid values are ignored.

Includes unit coverage, a Bun preset regression test, and updated runtime documentation.

Fixes #3454

@b-mounir-dev
b-mounir-dev requested a review from pi0 as a code owner July 11, 2026 18:48
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

@b-mounir-dev is attempting to deploy a commit to the Nitro Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The Bun preset now parses NITRO_BUN_IDLE_TIMEOUT, passes valid values to Bun.serve, documents the setting, and adds unit and runtime integration tests covering configuration forwarding and process cleanup.

Bun idle timeout

Layer / File(s) Summary
Timeout parsing and runtime wiring
src/presets/bun/runtime/_utils.ts, src/presets/bun/runtime/bun.ts, docs/2.deploy/10.runtimes/bun.md
Adds validation for values from 0 through 255, forwards valid values to Bun, and documents the environment variable.
Runtime forwarding test
test/presets/bun.test.ts, test/presets/fixtures/bun-preload.ts
Launches Bun with the timeout configured, exposes the value through a test endpoint, verifies the response, and terminates the process during cleanup.
Parser boundary tests
test/unit/bun-preset.test.ts
Covers valid boundary values and invalid, missing, negative, and out-of-range inputs.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The change restores env-based idleTimeout support, but the linked issue asked for server.bun.idleTimeout Nitro config support. Expose server.bun.idleTimeout in Nitro config and wire it through to Bun.serve idleTimeout.
Title check ⚠️ Warning The title is related to the change, but it does not follow conventional commit format. Use a conventional commit title like fix(bun): restore idle timeout environment variable.},{
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The documentation, runtime, utility, and test changes all align with the idle timeout feature and appear in scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The description matches the Bun idle timeout restore and mentions tests and docs.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@b-mounir-dev

Copy link
Copy Markdown
Author

Hi @pi0 , any updates on this plz ? We are currently using a small patch, but it would be more convinient if we could rely on an official fix upstream. Thanks

@b-mounir-dev b-mounir-dev changed the title fix(bun): restore idle timeout environment variable presets(bun): restore idle timeout environment variable Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

set custom Bun.serve idleTimeout

1 participant