Skip to content

Fix SESSION_TIMEOUT_MS=0 and BROWSER_IDLE_TIMEOUT_MS=0 (0 = never) - #9819

Open
audinue wants to merge 1 commit into
jo-inc:masterfrom
audinue:fix/zero-timeout-disabled
Open

Fix SESSION_TIMEOUT_MS=0 and BROWSER_IDLE_TIMEOUT_MS=0 (0 = never)#9819
audinue wants to merge 1 commit into
jo-inc:masterfrom
audinue:fix/zero-timeout-disabled

Conversation

@audinue

@audinue audinue commented Aug 29, 2026

Copy link
Copy Markdown

Summary

Fixes the handling of `SESSION_TIMEOUT_MS` and `BROWSER_IDLE_TIMEOUT_MS` when their value is `0`.

Before

  • `BROWSER_IDLE_TIMEOUT_MS=0` scheduled `setTimeout(..., 0)`, which shut the browser down immediately when idle — the opposite of the documented `0 = never`.
  • `SESSION_TIMEOUT_MS=0` collapsed to the `600000` default via `parseInt(...) || 600000`, so sessions still expired instead of never.

After

  • `0` now explicitly means disabled / never for both timeouts.
  • Unset env vars still fall back to their defaults (session: `600000`, idle: `300000`).
  • `scheduleBrowserIdleShutdown()` skips scheduling when `BROWSER_IDLE_TIMEOUT_MS <= 0`.
  • The session-cleanup interval skips expiry when `SESSION_TIMEOUT_MS <= 0`.
  • README updated so `SESSION_TIMEOUT_MS` documents `(0 = never)` to match `BROWSER_IDLE_TIMEOUT_MS`.

Verification

  • `node --check` passes on `lib/config.js` and `server.js`.
  • Parsing logic tested for unset / `0` / default-docs / custom values.

🤖 Generated with OpenCode

Previously:
- BROWSER_IDLE_TIMEOUT_MS=0 scheduled setTimeout(..., 0), shutting the
  browser down immediately instead of 'never' (as documented in README).
- SESSION_TIMEOUT_MS=0 collapsed to the 600000 default via '|| 600000',
  so sessions still expired instead of never.

Now 0 explicitly means 'disabled / never' for both timeouts, while unset
env vars still fall back to their defaults. The session-cleanup and
idle-shutdown code paths guard against <= 0 so a disabled timeout is a
no-op.
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.

1 participant