fix(events): settle WebSocket waiters when listeners throw (#2491)
## Summary - Continue delivering each event when an earlier callback throws, so detached one-time listeners and `emitted()` waiters settle and clean up their companions. - Rethrow the exact first callback failure, including `undefined`, `false`, and `Error`, after all same-event listeners have run. - Cover six stable/beta Realtime and Responses WebSocket transports, current server errors versus subsequent `PRIVATE_FUTURE_EVENT` payloads, terminal close, reentrant snapshots, and linear-time dispatch. ## Validation - Node 22.23 and Node 26.7: 6,866 handwritten tests and 556 generated tests on each runtime. - 20 regression failures on baseline; 98 focused and existing emitter tests pass with the fix. - Canonical lint, strict typing, build, published TypeScript 4.9 and 6, publint, ATTW (`Types ok!`), and packed-installed CommonJS/ESM checks.
H
Hayden committed
b5a13a7dc8c95669440ec87662bcae8227b398d9
Parent: 1b36c19
Committed by GitHub <noreply@github.com>
on 8/27/2026, 3:33:12 AM