Stop dispatching parent messages to self.onmessage in node:worker_threads workers #29215
Claude / Claude Code Review
completed
Apr 12, 2026 in 34m 21s
Code review found 1 important issue
Found 4 candidates, confirmed 2. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 1 |
| 🟡 Nit | 1 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🔴 Important | src/js/node/worker_threads.ts:344-346 |
test2 |
| 🟡 Nit | test/regression/issue/29211.test.ts:110-112 |
test |
Annotations
Check failure on line 346 in src/js/node/worker_threads.ts
claude / Claude Code Review
test2
Stale fn[wrappedListener] slot causes parentPortRemoveEventListener to silently fail after an on->off->addEventListener->removeEventListener sequence, leaving messageListenerCount permanently above zero so the worker hangs indefinitely. Fix: either clear fn[wrappedListener] in Class.prototype.off after successful removal, or add a fallback in parentPortRemoveEventListener that retries with the original listener key when the resolved-key lookup misses.
Check warning on line 112 in test/regression/issue/29211.test.ts
claude / Claude Code Review
test
All 9 test.concurrent() calls in test/regression/issue/29211.test.ts pass 30000 as the third (timeout) argument, directly violating the CRITICAL rule in test/CLAUDE.md: "Do not set a timeout on tests. Bun already has timeouts." Remove the third argument from every test.concurrent() call in this file.
Loading