Slack: handle message.channels and message.groups events#31701
Slack: handle message.channels and message.groups events#31701steipete merged 2 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR addresses an issue where Slack channel and group messages were not being processed when Slack dispatched them using typed event names ( Key changes:
Technical notes:
Confidence Score: 5/5
Last reviewed commit: 4d5ebc2 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d5ebc225a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ctx.app.event("message.channels", async ({ event, body }: SlackEventMiddlewareArgs) => { | ||
| await handleIncomingMessageEvent({ event, body }); | ||
| }); | ||
| ctx.app.event("message.groups", async ({ event, body }: SlackEventMiddlewareArgs) => { |
There was a problem hiding this comment.
Register typed DM message events too
This patch only adds listeners for message.channels and message.groups, but the same typed-dispatch mode also uses message.im and message.mpim for DM/MPIM subscriptions (which are still listed in our Slack setup docs). In workspaces where Bolt routes by these typed names, DM and group-DM messages will continue to bypass handleIncomingMessageEvent, so inbound Slack conversations can still be dropped even after this fix.
Useful? React with 👍 / 👎.
|
Landed via temp rebase onto main.
Thanks @liuxiaopai-ai! |
…h Bolt 4.6 Bolt 4.6 rejects app.event() calls with event names starting with "message." (e.g. "message.channels", "message.groups"), throwing AppInitializationError on startup. These handlers were added in openclaw#31701 based on the incorrect assumption that Slack dispatches typed event names to Bolt. In reality, Slack always delivers events with type:"message" regardless of the Event Subscription name; the channel_type field distinguishes the source. The generic app.event("message") handler already receives all channel, group, IM, and MPIM messages. The additional typed handlers were unreachable even if Bolt allowed them, since no event payload ever carries type:"message.channels". This preserves the handleIncomingMessageEvent refactor from openclaw#31701 (extracting the handler into a named function) while removing only the broken registrations. Fixes the Slack provider crash loop affecting all accounts on @slack/bolt >= 4.6.0. Closes openclaw#31674 (original issue was not caused by missing handlers)
…h Bolt 4.6 Bolt 4.6 rejects app.event() calls with event names starting with "message." (e.g. "message.channels", "message.groups"), throwing AppInitializationError on startup. These handlers were added in openclaw#31701 based on the incorrect assumption that Slack dispatches typed event names to Bolt. In reality, Slack always delivers events with type:"message" regardless of the Event Subscription name; the channel_type field distinguishes the source. The generic app.event("message") handler already receives all channel, group, IM, and MPIM messages. The additional typed handlers were unreachable even if Bolt allowed them, since no event payload ever carries type:"message.channels". This preserves the handleIncomingMessageEvent refactor from openclaw#31701 (extracting the handler into a named function) while removing only the broken registrations. Fixes the Slack provider crash loop affecting all accounts on @slack/bolt >= 4.6.0. Closes openclaw#31674 (original issue was not caused by missing handlers)
…h Bolt 4.6 Bolt 4.6 rejects app.event() calls with event names starting with "message." (e.g. "message.channels", "message.groups"), throwing AppInitializationError on startup. These handlers were added in openclaw#31701 based on the incorrect assumption that Slack dispatches typed event names to Bolt. In reality, Slack always delivers events with type:"message" regardless of the Event Subscription name; the channel_type field distinguishes the source. The generic app.event("message") handler already receives all channel, group, IM, and MPIM messages. The additional typed handlers were unreachable even if Bolt allowed them, since no event payload ever carries type:"message.channels". This preserves the handleIncomingMessageEvent refactor from openclaw#31701 (extracting the handler into a named function) while removing only the broken registrations. Fixes the Slack provider crash loop affecting all accounts on @slack/bolt >= 4.6.0. Closes openclaw#31674 (original issue was not caused by missing handlers)
…h Bolt 4.6 (#32033) * fix(slack): remove message.channels/message.groups handlers that crash Bolt 4.6 Bolt 4.6 rejects app.event() calls with event names starting with "message." (e.g. "message.channels", "message.groups"), throwing AppInitializationError on startup. These handlers were added in #31701 based on the incorrect assumption that Slack dispatches typed event names to Bolt. In reality, Slack always delivers events with type:"message" regardless of the Event Subscription name; the channel_type field distinguishes the source. The generic app.event("message") handler already receives all channel, group, IM, and MPIM messages. The additional typed handlers were unreachable even if Bolt allowed them, since no event payload ever carries type:"message.channels". This preserves the handleIncomingMessageEvent refactor from #31701 (extracting the handler into a named function) while removing only the broken registrations. Fixes the Slack provider crash loop affecting all accounts on @slack/bolt >= 4.6.0. Closes #31674 (original issue was not caused by missing handlers) * fix: document Slack Bolt 4.6 startup handler fix (#32033) (thanks @mahopan) --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
…h Bolt 4.6 (openclaw#32033) * fix(slack): remove message.channels/message.groups handlers that crash Bolt 4.6 Bolt 4.6 rejects app.event() calls with event names starting with "message." (e.g. "message.channels", "message.groups"), throwing AppInitializationError on startup. These handlers were added in openclaw#31701 based on the incorrect assumption that Slack dispatches typed event names to Bolt. In reality, Slack always delivers events with type:"message" regardless of the Event Subscription name; the channel_type field distinguishes the source. The generic app.event("message") handler already receives all channel, group, IM, and MPIM messages. The additional typed handlers were unreachable even if Bolt allowed them, since no event payload ever carries type:"message.channels". This preserves the handleIncomingMessageEvent refactor from openclaw#31701 (extracting the handler into a named function) while removing only the broken registrations. Fixes the Slack provider crash loop affecting all accounts on @slack/bolt >= 4.6.0. Closes openclaw#31674 (original issue was not caused by missing handlers) * fix: document Slack Bolt 4.6 startup handler fix (openclaw#32033) (thanks @mahopan) --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
…h Bolt 4.6 (openclaw#32033) * fix(slack): remove message.channels/message.groups handlers that crash Bolt 4.6 Bolt 4.6 rejects app.event() calls with event names starting with "message." (e.g. "message.channels", "message.groups"), throwing AppInitializationError on startup. These handlers were added in openclaw#31701 based on the incorrect assumption that Slack dispatches typed event names to Bolt. In reality, Slack always delivers events with type:"message" regardless of the Event Subscription name; the channel_type field distinguishes the source. The generic app.event("message") handler already receives all channel, group, IM, and MPIM messages. The additional typed handlers were unreachable even if Bolt allowed them, since no event payload ever carries type:"message.channels". This preserves the handleIncomingMessageEvent refactor from openclaw#31701 (extracting the handler into a named function) while removing only the broken registrations. Fixes the Slack provider crash loop affecting all accounts on @slack/bolt >= 4.6.0. Closes openclaw#31674 (original issue was not caused by missing handlers) * fix: document Slack Bolt 4.6 startup handler fix (openclaw#32033) (thanks @mahopan) --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
…h Bolt 4.6 (openclaw#32033) * fix(slack): remove message.channels/message.groups handlers that crash Bolt 4.6 Bolt 4.6 rejects app.event() calls with event names starting with "message." (e.g. "message.channels", "message.groups"), throwing AppInitializationError on startup. These handlers were added in openclaw#31701 based on the incorrect assumption that Slack dispatches typed event names to Bolt. In reality, Slack always delivers events with type:"message" regardless of the Event Subscription name; the channel_type field distinguishes the source. The generic app.event("message") handler already receives all channel, group, IM, and MPIM messages. The additional typed handlers were unreachable even if Bolt allowed them, since no event payload ever carries type:"message.channels". This preserves the handleIncomingMessageEvent refactor from openclaw#31701 (extracting the handler into a named function) while removing only the broken registrations. Fixes the Slack provider crash loop affecting all accounts on @slack/bolt >= 4.6.0. Closes openclaw#31674 (original issue was not caused by missing handlers) * fix: document Slack Bolt 4.6 startup handler fix (openclaw#32033) (thanks @mahopan) --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
…h Bolt 4.6 (openclaw#32033) * fix(slack): remove message.channels/message.groups handlers that crash Bolt 4.6 Bolt 4.6 rejects app.event() calls with event names starting with "message." (e.g. "message.channels", "message.groups"), throwing AppInitializationError on startup. These handlers were added in openclaw#31701 based on the incorrect assumption that Slack dispatches typed event names to Bolt. In reality, Slack always delivers events with type:"message" regardless of the Event Subscription name; the channel_type field distinguishes the source. The generic app.event("message") handler already receives all channel, group, IM, and MPIM messages. The additional typed handlers were unreachable even if Bolt allowed them, since no event payload ever carries type:"message.channels". This preserves the handleIncomingMessageEvent refactor from openclaw#31701 (extracting the handler into a named function) while removing only the broken registrations. Fixes the Slack provider crash loop affecting all accounts on @slack/bolt >= 4.6.0. Closes openclaw#31674 (original issue was not caused by missing handlers) * fix: document Slack Bolt 4.6 startup handler fix (openclaw#32033) (thanks @mahopan) --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
…h Bolt 4.6 (openclaw#32033) * fix(slack): remove message.channels/message.groups handlers that crash Bolt 4.6 Bolt 4.6 rejects app.event() calls with event names starting with "message." (e.g. "message.channels", "message.groups"), throwing AppInitializationError on startup. These handlers were added in openclaw#31701 based on the incorrect assumption that Slack dispatches typed event names to Bolt. In reality, Slack always delivers events with type:"message" regardless of the Event Subscription name; the channel_type field distinguishes the source. The generic app.event("message") handler already receives all channel, group, IM, and MPIM messages. The additional typed handlers were unreachable even if Bolt allowed them, since no event payload ever carries type:"message.channels". This preserves the handleIncomingMessageEvent refactor from openclaw#31701 (extracting the handler into a named function) while removing only the broken registrations. Fixes the Slack provider crash loop affecting all accounts on @slack/bolt >= 4.6.0. Closes openclaw#31674 (original issue was not caused by missing handlers) * fix: document Slack Bolt 4.6 startup handler fix (openclaw#32033) (thanks @mahopan) --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
Summary
message.channelsandmessage.groupsTesting
Closes #31674