Preserve AsyncLocalStorage context during dynamic import() module evaluation - #32695
Closed
robobun wants to merge 5 commits into
Closed
Preserve AsyncLocalStorage context during dynamic import() module evaluation#32695robobun wants to merge 5 commits into
robobun wants to merge 5 commits into
Claude / Claude Code Review
completed
Jun 25, 2026 in 10m 10s
Code review found 1 important issue
Found 5 candidates, confirmed 1. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 1 |
| 🟡 Nit | 0 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🔴 Important | src/jsc/bindings/ZigGlobalObject.cpp:3620-3626 |
Map entry leaks when dynamic import rejects asynchronously |
Annotations
Check failure on line 3626 in src/jsc/bindings/ZigGlobalObject.cpp
claude / Claude Code Review
Map entry leaks when dynamic import rejects asynchronously
The map entry inserted at line 3607 is only removed when `moduleLoaderEvaluate` runs for the key or when the import promise has *already* settled here — if `importModule` returns a Pending promise that later **rejects asynchronously** (syntax error in the imported file, a transitive static dependency that fails to resolve/parse, or an async `Bun.plugin` `onLoad` rejection), neither path fires and the entry is retained for the lifetime of the global, pinning the captured async context and everyth
Loading