Skip to content

fix(socket-mode): await client disconnect on shutdown - #3042

Open
Grmiade wants to merge 2 commits into
slackapi:mainfrom
Grmiade:grmiade/await-socket-mode-shutdown
Open

fix(socket-mode): await client disconnect on shutdown#3042
Grmiade wants to merge 2 commits into
slackapi:mainfrom
Grmiade:grmiade/await-socket-mode-shutdown

Conversation

@Grmiade

@Grmiade Grmiade commented Aug 13, 2026

Copy link
Copy Markdown

Problem

SocketModeReceiver.stop() calls SocketModeClient.disconnect() but resolves immediately instead of awaiting it. Applications can therefore log that shutdown completed while the Socket Mode WebSocket close handshake is still in progress.

Solution

Await the Socket Mode client's disconnect promise before resolving SocketModeReceiver.stop(). This makes await app.stop() reflect the actual receiver lifecycle and adds a regression test for the pending disconnect case.

Validation

  • npx @biomejs/biome check src/receivers/SocketModeReceiver.ts test/unit/receivers/SocketModeReceiver.spec.ts
  • Full build currently blocked by existing strict TypeScript errors in src/Assistant.ts and src/helpers.ts on the cloned main branch.
  • Focused Mocha execution is blocked by the existing rewiremock bootstrap error on Node 24.

@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 765ac9e

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

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