Skip to content

fix(socket-mode): suppress heartbeat warning during shutdown - #2697

Open
Grmiade wants to merge 1 commit into
slackapi:mainfrom
Grmiade:grmiade/fix-socket-mode-shutdown-heartbeat
Open

fix(socket-mode): suppress heartbeat warning during shutdown#2697
Grmiade wants to merge 1 commit into
slackapi:mainfrom
Grmiade:grmiade/fix-socket-mode-shutdown-heartbeat

Conversation

@Grmiade

@Grmiade Grmiade commented Aug 13, 2026

Copy link
Copy Markdown

Problem

When a Socket Mode application shuts down, the client sends a WebSocket close frame but leaves its heartbeat interval active until the peer completes the close handshake. If Slack does not send a pong in the 5-second heartbeat window, the SDK logs A pong wasn't received from the server before the timeout of 5000ms! even though the disconnect was intentional.

Solution

Stop heartbeat monitoring immediately for explicit SocketModeClient.disconnect() calls, while preserving heartbeat detection for unexpected connection failures. The close handshake and disconnected lifecycle event remain unchanged.

Validation

  • npm run test:unit --workspace @slack/socket-mode
  • npx @biomejs/biome check packages/socket-mode/src/SocketModeClient.ts packages/socket-mode/src/SlackWebSocket.ts packages/socket-mode/src/SlackWebSocket.test.ts

@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2253dff

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

This PR includes changesets to release 1 package
Name Type
@slack/socket-mode 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

@Grmiade
Grmiade marked this pull request as ready for review August 13, 2026 18:11
@Grmiade
Grmiade requested a review from a team as a code owner August 13, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant