Skip to content

feat: declare undici as a peer dependency for Socket Mode - #3040

Open
WilliamBergamin wants to merge 11 commits into
mainfrom
feat/undici-peer-dependency
Open

WilliamBergamin wants to merge 11 commits into
mainfrom
feat/undici-peer-dependency

Conversation

@WilliamBergamin

@WilliamBergamin WilliamBergamin commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolves #3039.

@slack/bolt constructs a SocketModeClient from @slack/socket-mode@3, which declares undici@^7 as a peer dependency. Because Bolt neither declared nor forwarded undici, installs on strict package managers (Yarn Berry, pnpm) surfaced an unmet-peer-dependency error — npm papered over it via transitive resolution, but stricter resolvers did not.

This PR declares undici as a peer dependency of @slack/bolt so the requirement is explicit at Bolt's own install boundary. Socket Mode users on strict package managers should install undici alongside @slack/bolt.

The peer range is pinned to ^7.28.0 (not ^7.0.0) to keep consumers off undici releases affected by CVE-2026-12151 / GHSA-vxpw-j846-p89q.

Requirements

WilliamBergamin and others added 8 commits August 10, 2026 12:51
Design and implementation plan for declaring undici as a peer dependency
required by @slack/socket-mode@3, with a drift-guard test.

Refs: #3039

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@slack/socket-mode@3 declares undici@^7 as a peer dependency, which Bolt
constructs internally via SocketModeClient. Declare it as a Bolt peer so
the dependency graph is complete under strict package managers (Yarn/pnpm).
Add semver + @types/semver as devDependencies for the drift-guard test.

Refs: #3039

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Reads the installed @slack/socket-mode peerDependencies.undici at test time
and asserts Bolt's declared range is a semver subset, so the two can't
silently fall out of sync.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Add changeset and a Socket Mode install note for strict package managers.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Drop the install note added earlier; keep the changeset entry.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Drop the drift-guard spec and the now-unused semver / @types/semver
devDependencies. The undici peerDependency declaration remains.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Remove semver and @types/semver, which were only used by the drift-guard
test removed in the previous commit.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Drop the spec and plan scaffolding docs; they are not part of the change.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@WilliamBergamin
WilliamBergamin requested a review from a team as a code owner August 10, 2026 20:40
@changeset-bot

changeset-bot Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 408814a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@slack/bolt Patch

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

@WilliamBergamin WilliamBergamin self-assigned this Aug 10, 2026
@WilliamBergamin WilliamBergamin added this to the @slack/bolt@next milestone Aug 10, 2026
@WilliamBergamin WilliamBergamin added semver:patch dependencies Pull requests that update a dependency file labels Aug 10, 2026
@codecov

codecov Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.38%. Comparing base (64f658c) to head (408814a).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3040   +/-   ##
=======================================
  Coverage   94.38%   94.38%           
=======================================
  Files          43       43           
  Lines        7426     7426           
  Branches      704      704           
=======================================
  Hits         7009     7009           
  Misses        408      408           
  Partials        9        9           

☔ 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.

The undici peer range permitted versions affected by CVE-2026-12151
(GHSA-vxpw-j846-p89q), a high-severity WebSocket denial-of-service
(unbounded fragment count). undici 7.28.0 is the first patched 7.x
release. Bump the peer range to ^7.28.0 and refresh the resolved
lockfile version accordingly.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📣 A comment of support overall but it might be a separate task to address? Marking as LGTM in a positive step forward!

Comment thread package.json
"peerDependencies": {
"@types/express": "^5.0.0"
"@types/express": "^5.0.0",
"undici": "^7.28.0"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏆 praise: This is a good pattern to extend I think! Documentation might need to be updated for certain cases but I don't think that's needed right now.

🔬 question: With context of adjacent PR slackapi/node-slack-sdk#2694 would we want to support undici@^8 here as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yess I merged slackapi/node-slack-sdk#2694 we need to release it and then apply the same pattern here as well 🤔

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bolt 5 does not provide the undici peer required by @slack/socket-mode 3

2 participants