interactive-messages: log payload object when handler not found #928
Labels
enhancement
M-T: A feature request for new functionality
pkg:interactive-messages (deprecated)
applies to `@slack/interactive-messages`
Description
The callback registration pattern is a powerful way to decouple the concerns of handling slack interactive-message callbacks, separating request parsing and validation logic common to all slack app callbacks from the business logic of handling and responding to those callbacks.
One thing I struggled with when moving from handling the raw requests myself to using the
@slack/interactive-messages@1.4.0
package was losing access to the raw request or underlying payload. Once I had a handler matching I could see the payload inside my handler to learn how to better handle that type of payload. When I didn't have any matching handler, however, I couldn't understand why my matchers were failing to match.In these cases when no handler is found it would be very useful to expose the raw payload in the interactive-messages adapter debug logs.
This could be as simple as adding the following:
to the
adapter.dispatch(...)
method just after logging that "dispatch could not find a handler"What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Packages:
Select all that apply:
@slack/web-api
@slack/events-api
@slack/interactive-messages
@slack/rtm-api
@slack/webhooks
Reproducible in:
package version:
node version:
v10.16.0
OS version(s):
Steps to reproduce:
callback_id
value)dispatch could not find a handler
message in the logsExpected result:
See the raw
{ payload }
object in the logs so that I can learn what slack sends and compare it to my registered matchers to understand why none of my handlers matched.Actual result:
Cannot see the inputs (the payload) so cannot understand why my configured callback handlers didn't match and fire.
The text was updated successfully, but these errors were encountered: