feat(socket-mode): support undici v8 as a peer dependency - #2694
Conversation
Widen the `undici` peer dependency range to `^7.0.0 || ^8.0.0` so consumers can bring either major. undici v8 requires Node >=22.19, while v7 continues to support Node >=20 — the source needs no changes, as v8 preserves every API socket-mode uses. CI now pairs each Node version with an undici major via a `versions` matrix and forces the socket-mode workspace onto that major before running the suite, so v8 support is actually exercised on capable Node versions. A new guardrail test asserts the Node/undici pairing (and never allows v8 on Node <22.19). Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
🦋 Changeset detectedLatest commit: 7e1e685 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2694 +/- ##
==========================================
+ Coverage 89.12% 89.20% +0.07%
==========================================
Files 65 65
Lines 10441 10442 +1
Branches 482 480 -2
==========================================
+ Hits 9306 9315 +9
+ Misses 1103 1095 -8
Partials 32 32
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Reduce the undici peer-dependency test to its two assertions, drop the comment essays and the general-purpose version-comparison helper in favor of a plain Node major check, and rename SOCKET_MODE_EXPECT_UNDICI_MAJOR to SOCKET_MODE_UNDICI_VERSION. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
|
@zimeg I'll need to update the status checks if we want to merge this |
zimeg
left a comment
There was a problem hiding this comment.
@WilliamBergamin LGTM! I'm bummed CI wasn't calling this out with regular installations but this is a good fix to include.
🧪 Longterm I'm worried about testing compatible dependencies with unit tests but let's get this merged to address an issue!
| }, | ||
| "peerDependencies": { | ||
| "undici": "^7.0.0" | ||
| "undici": "^7.0.0 || ^8.0.0" |
There was a problem hiding this comment.
🎯 praise: Thanks for keeping support consistent!
Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com>
… job undici v8 flips buildConnector's allowH2 default to true, so the default dispatcher offered h2 over ALPN. Pin allowH2: false so the WebSocket stays on HTTP/1.1 (where the force-destroy fallback holds) on both majors. A test parses the ALPN list from the raw ClientHello (no certificate needed) and asserts the client only offers http/1.1; it fails on v8 without the fix. CI: restore the original matrix (undici v7 on every Node) and add a socket-mode-undici-v8 job on Node 22/24/26. Drop the guardrail unit test, whose inverted assertion failed every job; the job checks the installed major inline instead. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
a9623e1 to
bb11653
Compare
Replaces the separate socket-mode-undici-v8 job. The steps run on every Node except 20.x (undici v8 needs >=22.19), on both ubuntu and windows, after the codecov uploads so socket-mode's v7 test results aren't overwritten. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Add an undici dimension (excluding Node 20 + v8, since v8 needs >=22.19) in place of the extra steps. Job names gain the undici version, so the required status checks on main need updating to match. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Slack's WebSocket hosts negotiate HTTP/1.1 today, so the allowH2: false pin stays as cheap insurance without a dedicated test. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Summary
Expand
@slack/socket-modeto support bothundici@^7andundici@^8as a peer dependency.peerDependencies.undicito^7.0.0 || ^8.0.0. The source needs no logic changesversions: [{ node, undici }]matrix and forces the socket-mode workspace onto that major before running the suite.Requirements