Skip to content

fix(humanize): preserve timeout: 0 semantics - #496

Open
Iams4kura wants to merge 1 commit into
CloakHQ:mainfrom
Iams4kura:bugfix/preserve-timeout-zero-semantics-20260810t000342z
Open

fix(humanize): preserve timeout: 0 semantics#496
Iams4kura wants to merge 1 commit into
CloakHQ:mainfrom
Iams4kura:bugfix/preserve-timeout-zero-semantics-20260810t000342z

Conversation

@Iams4kura

Copy link
Copy Markdown

Summary

  • Fixes: Ready Page and ElementHandle actions fail before their first actionability check when callers pass Playwright's timeout: 0 option, even though zero is documented to disable the timeout.
  • Root cause: Each action converted the raw numeric timeout directly into Date.now() + timeout. That collapsed raw zero into an already-expired deadline, while forwarding numeric remaining values also made it impossible to distinguish a genuinely exhausted finite budget from Playwright's special zero value.

Regression evidence

  • Before: cd js && npx --yes node@20 node_modules/vitest/vitest.mjs run tests/humanize.test.ts -t 'keeps a ready humanized page action timeout-free' exited 1

  • After: cd js && npx --yes node@20 node_modules/vitest/vitest.mjs run tests/humanize.test.ts -t 'keeps a ready humanized page action timeout-free' exited 0

Verification

  • cd js && npx --yes node@20 node_modules/vitest/vitest.mjs run tests/humanize.test.ts
  • cd js && npx --yes node@20 node_modules/vitest/vitest.mjs run
  • cd js && npx --yes node@20 node_modules/typescript/bin/tsc
  • cd js && npx --yes node@20 node_modules/typescript/bin/tsc --noEmit

Scope

  • 6 files changed, +285 / -139 lines

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