Skip to content

OptimizedNodeBridge should guard against negative/NaN timeoutMs #114

@bbopen

Description

@bbopen

Problem

timeoutMs is accepted without validation. If callers pass NaN, Infinity, or negative values, the per-request timeout timer may fire immediately or never fire, breaking timeout enforcement. NodeBridge has similar weak validation but timeoutMs is used more widely in OptimizedNodeBridge (queue wait, timeouts, TTL).

Evidence

  • src/runtime/optimized-node.ts: timeoutMs assigned directly to options with no normalization; used in setTimeout and TTL calculations.

Acceptance criteria

  • Normalize invalid timeoutMs to a safe default (e.g., 30000) or clamp to a minimum > 0.
  • Add tests for NaN, Infinity, negative values.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions