Skip to content

Honor a numeric timeout of 0 instead of using the 5000ms default - #90

Open
official-burak wants to merge 1 commit into
expressjs:masterfrom
official-burak:fix/zero-timeout-not-default
Open

Honor a numeric timeout of 0 instead of using the 5000ms default#90
official-burak wants to merge 1 commit into
expressjs:masterfrom
official-burak:fix/zero-timeout-not-default

Conversation

@official-burak

@official-burak official-burak commented Aug 31, 2026

Copy link
Copy Markdown

timeout(0) waited five seconds because time || 5000 is falsy for zero. timeout("0ms") already meant zero milliseconds.

The default when time is omitted or null is still 5000ms.

time || 5000 is falsy for zero, so timeout(0) waited five seconds. timeout("0ms") already meant zero milliseconds.

@kilisamemarisaaa kilisamemarisaaa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the numeric-zero fix on commit 8cf5a72. The change preserves the documented default for omitted/null time while allowing an explicit numeric 0 to schedule an immediate timeout. Verification on Windows with Node 24.12.0: npm test (14 passing), npm run lint (pass), plus a direct middleware check confirming undefined/null -> 5000ms and 0 -> 0ms. I found no correctness issues.

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.

2 participants