Skip to content

fix(socket-mode): handle Events API payloads without inner events - #2754

Draft
kyungyeon-byun-imweb-me wants to merge 1 commit into
slackapi:mainfrom
kyungyeon-byun-imweb-me:fix/socket-mode-events-without-inner-event
Draft

kyungyeon-byun-imweb-me wants to merge 1 commit into
slackapi:mainfrom
kyungyeon-byun-imweb-me:fix/socket-mode-events-without-inner-event

Conversation

@kyungyeon-byun-imweb-me

Copy link
Copy Markdown

Summary

Fixes #2753.

SocketModeClient currently assumes every events_api payload contains payload.event.type. Slack's documented app_rate_limited payload has its event type at the top level and no inner event, so that assumption throws before consumers can acknowledge the envelope.

This change:

  • dispatches a valid inner event when present, preserving existing behavior;
  • otherwise dispatches a valid top-level payload type, including app_rate_limited;
  • skips only the specific event emission for malformed payloads while preserving the generic slack_event emission and ACK function;
  • adds focused regression coverage for normal callbacks, app_rate_limited, malformed payloads, and invalid inner-event type fallback;
  • includes a patch changeset for @slack/socket-mode.

Validation completed:

  • npm run build --workspace=@slack/logger
  • npm run build --workspace=@slack/types
  • npm run build --workspace=@slack/web-api
  • npm run build --workspace=@slack/socket-mode
  • npm test --workspace=@slack/socket-mode (43 passing)
  • npm run lint

Requirements

@changeset-bot

changeset-bot Bot commented Oct 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4f1ff57

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

@salesforce-cla

salesforce-cla Bot commented Oct 1, 2026

Copy link
Copy Markdown

Thanks for the contribution! Before we can merge this, we need @kyungyeon-byun-imweb-me to sign the Salesforce Inc. Contributor License Agreement.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SocketModeClient crashes on Events API payloads without an inner event

1 participant