Skip to content

fix: use legacy global dispatcher in v7#5368

Merged
ronag merged 1 commit into
v7.xfrom
fix-v7-global-dispatcher-slot
Jun 6, 2026
Merged

fix: use legacy global dispatcher in v7#5368
ronag merged 1 commit into
v7.xfrom
fix-v7-global-dispatcher-slot

Conversation

@mcollina

@mcollina mcollina commented Jun 6, 2026

Copy link
Copy Markdown
Member

Summary

  • make v7 getGlobalDispatcher() always read Symbol.for('undici.globalDispatcher.1')
  • add a regression test that poisons the v2 global dispatcher slot and verifies v7 fetch still uses the v1 dispatcher

Reproduction

A minimal reproduction is available at:

https://github.com/mcollina/undici-7-8-global-dispatcher-repro

It installs only undici@7.27.1 and undici@8.3.0. The failure happens when undici v8 installs the global dispatcher and undici v7 fetch reads the v2 dispatcher slot while still using the v1 handler shape.

Tests

  • npx borp --timeout 180000 -p "test/node-test/global-dispatcher-version.js"
  • npm run lint -- test/node-test/global-dispatcher-version.js lib/global.js

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.89%. Comparing base (4527877) to head (010bb7d).

Additional details and impacted files
@@           Coverage Diff           @@
##             v7.x    #5368   +/-   ##
=======================================
  Coverage   92.89%   92.89%           
=======================================
  Files         112      112           
  Lines       35843    35843           
=======================================
+ Hits        33297    33298    +1     
+ Misses       2546     2545    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ronag ronag merged commit c03ed25 into v7.x Jun 6, 2026
36 of 37 checks passed
@ronag ronag deleted the fix-v7-global-dispatcher-slot branch June 6, 2026 07:54
@github-actions github-actions Bot mentioned this pull request Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants