fix(ws): allow ws.once() to work multiple times
Merged
RO
10mo ago+225+225+012345678901234567890123456789-2-2-0123456789
Summary
- Fixes
ws.once()only working on the first call for each event type - The bug was in the
#onOrOncemethod which tracked native listeners via a bitset but didn't account foroncelisteners auto-removing after firing - Now only persistent
on()listeners set the bitset;once()listeners always add new native handlers unless a persistent listener already exists
Test plan
- Added regression test
test/regression/issue/26358.test.ts - Test verifies
once('message')works multiple times - Test verifies
once('pong')works multiple times - Test verifies
on()still works correctly - Test verifies mixing
on()andonce()works correctly - Verified test fails with
USE_SYSTEM_BUN=1(bug exists) - Verified test passes with
bun bd test(fix works)
Fixes #26358
š¤ Generated with Claude Code