Skip to content

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

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

feat: declare undici as a peer dependency for Socket Mode#3040
WilliamBergamin wants to merge 9 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: b2a569d

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.33%. Comparing base (9a45c3c) to head (b2a569d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3040   +/-   ##
=======================================
  Coverage   94.33%   94.33%           
=======================================
  Files          43       43           
  Lines        7360     7360           
  Branches      679      679           
=======================================
  Hits         6943     6943           
  Misses        409      409           
  Partials        8        8           

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

1 participant