`message_replied` subtype doesn't not invoke
(Filling out the following with as much detail as you can provide will help us solve your issue sooner.)
@slack/bolt version
4.4.0
Your App and Receiver Configuration
App({
token,
signingSecret,
appToken,
socketMode: true,
deferInitialization: true,
customRoutes: [atlassianAuthCallbackRoute],
});
Node.js runtime version
Node.js v22.14.0
Steps to reproduce:
(Share the commands to run, source code, and project settings)
- listen to the
message_repliedmessage subtype. - try to reply in a thread
Expected result:
The expected result would be that the app.message will invoke the callback.
Actual result:
The callback never gets invoked, the app isn't reaching the console.log.
app.message(subtype('message_replied'), async ({ message, event, context, payload }) => {
console.log({ message, event, payload, context });
});
Requirements
For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. :bow:
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
Hi, @KevinEdry! Thanks for submitting this issue?
Just to check, are you subscribing to the message_replied event via the Events Subscription page for your app configuration?
Hey @hello-ashleyintech, thanks for the quick response.
I tried, but it prompts me that there is no such event.
Hey @hello-ashleyintech, thanks for the quick response.
I tried, but it prompts me that there is no such event.
I believe that the events you can subscribe to are only the "top-level" events. Sub types need to be inferred and handled by your application logic.
If you look at this link you will see that there is a bug alert:
Bug alert! This event is missing the subtype field when dispatched over the Events API. Until it is fixed, examine message events' thread_ts value. When present, it's a reply. To be doubly sure, compare a thread_ts to the top-level ts value, when they differ the latter is a reply to the former.
This may be why your subtype() handler does not pick it up adequately.
Lastly, please verify that you have the necessary scopes for this event: https://api.slack.com/events/message/message_replied#facts
👋 @jfbn This might be related to https://github.com/slackapi/node-slack-sdk/issues/2025 with the bug alert shared 📚
A workaround of filtering out undefined thread_ts for a message event is included in comment and might be useful here!
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.
🗣️ Let's keep this issue open! We might want to add a warning to the subtype handler to avoid confusion during development. A backend change isn't planned in neartimes AFAICT:
https://github.com/slackapi/bolt-js/blob/9337e0616f058f1459ef1ad922dfba38048dac3b/src/middleware/builtin.ts#L343-L352