You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pool loses caller's AsyncLocalStorage context for queued HTTPS requests (Undici 8) #5981
Steps to reproduce (if not using the script above):
Expected Behavior
/a → a
/b → b
/c → c
Every request dispatches in the async context of its own fetch() / request() caller, whether it was sent immediately or queued behind the connection probe.
Actual Behavior
/a → a
/b → a
/c → a
Same with request() from the undici package. Only https: origins are affected. http://example.com prints a, b, c correctly on the same version. Cause: Pool defers /b and /c until /a's connection finishes ALPN negotiation, then dispatches them from /a's connect callback, so they inherit /a's async context.
Logs & Screenshots
Environment
OS:
Node.js version:
undici version:
Additional context
Discovered in a test failure in MSW (see job) after Undici introduced changes in Node.js v26 (passes in v22 and v24).
Let me know if this sounds like something Undici should fix. We rely on ALS in MSW for various reasons and this breaks the fetch interception for us on Node.js v26. Thanks!
Activity
kettanaito commentedon Oct 8, 2026
Let me know if this sounds like something Undici should fix. We rely on ALS in MSW for various reasons and this breaks the fetch interception for us on Node.js v26. Thanks!