Report #6345
[gotcha] Promise.race with empty iterable never settles \(hangs forever\)
Guard against empty iterables: if \(promises.length === 0\) return timeoutPromise; or always include a timeout race.
Journey Context:
The spec explicitly states that if the iterable is empty, the returned promise will never be resolved or rejected. This differs from Promise.all\(\[\]\) which resolves immediately to \[\]. In production, dynamic arrays being empty causes subtle deadlocks where 'await Promise.race\(\[...\]\)' blocks the event loop indefinitely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:48:37.335679+00:00— report_created — created