-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
receiverAckTimeoutError should not throw if authorization of incoming event fails #364
Comments
👋Thank you for flagging this up.
I agree that this part of the error message is not relevant to this case. Currently, Bolt doesn't respond to a request in the case mentioned here. In the case of denied requests, personally I prefer to respond with HTTP status code 40x than just not responding. However, if Bolt changes the behavior to respond with an error status code in future versions, it needs updates on the interface between I would like to know @aoberoi @stevengill 's thoughts on this. |
@seratch I would like to respond to the denied request but i'm unsure how to do that from the scope of the |
At this moment, it's not possible to respond to requests in the case.
That's why I mentioned the necessity to change |
@aoberoi ☝️ This is a really good example of why I think |
Is it possible to prevent |
@seratch do you have any suggestions to prevent this error from firing?
|
@stevengill are there any temporary workarounds that I can perform to prevent this error / warning from firing? It creates a lot of noise. |
#891 can improve this. When I started working on the pull request again, I will check if it resolves this issue as well. |
I've confirmed that #891 can resolve this issue. import { App, ExpressReceiver } from '@slack/bolt';
const app = new App({
receiver: new ExpressReceiver({
signingSecret: process.env.SLACK_SIGNING_SECRET!!,
}),
authorize: async (_) => { throw new Error("Failed!"); }
}); The above example app returns 401 HTTP status and shows the following logs only:
|
Description
When an incoming event fails to authenticate via Bolt's
authorizeFn
, the following warning is thrown:https://github.com/slackapi/bolt/blob/227421b324bcf5548d1263db7b61fc66eb407908/src/App.ts#L395
Then, the following error is thrown that the incoming event is not acknowledged.
https://github.com/slackapi/bolt/blob/6cd88eb3a6246405dee9afe06f793ed7c59958f2/src/ExpressReceiver.ts#L75-L78
Is this the expected design? If listeners are not being called, why do we need to call
ack()
?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.
Reproducible in:
package version: >= 1.2.0
node version: v12.12.0
OS version(s): macOS Catalina 10.15.1
Steps to reproduce:
authorizeFn
, do not authorize an incoming event.Expected result:
Incoming event is not sent to listeners.
receiverAckTimeoutError
is not thrown.Actual result:
receiverAckTimeoutError
is thrown.Attachments:
The text was updated successfully, but these errors were encountered: