mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
## Summary Fixes #22635 - MessagePort communication fails after being transferred to a Worker thread. Fixes https://github.com/oven-sh/bun/issues/22636 The issue was that `MessagePort::addEventListener()` only called `start()` for attribute listeners (like `onmessage = ...`) but not for regular event listeners added via `addEventListener()` or the Node.js EventEmitter wrapper (`.on('message', ...)`). ## Changes - Modified `MessagePort::addEventListener()` to call `start()` for all message event listeners, not just attribute listeners - Added regression test for issue #22635 ## Test Plan - [x] Regression test added and passing - [x] Original reproduction case from issue #22635 now works correctly - [x] Existing MessagePort tests still pass 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>