Closed glebkrapivin closed 3 months ago
Thanks @glebkrapivin for writing in 💯
This seems like a real bug, this issue could be a feature request
, did you intend to close it?
@WilliamBergamin
I've read the docs where it says that there is no processing should be done, so i guessed it was the desired behavior of the sdk
For my side i solved it with setting raise_error_for_unhandled_request
and adding something like
@app.error
def handle_error(response):
response.status = 500
@WilliamBergamin When process_before_response is set to False (the default setting), this is an expected behavior. This is not a bug. The issue reporter might notice it afterwards.
Ah, I posted my above comment at the same timing!
I meant that, when process_before_response is set to False (when you don't pass the argument to App constructor, the value is False by default), the error within your @app.event
listener does not affect the HTTP response status. Responding to a request from Slack would be done asynchronously regardless of your listener execution result. If you desire to return a 500 error when your listener fails, you can set process_before_response=True in App constructor. A downside of this approach is that your listener execution must complete within 3 seconds (this is a requirement by Slack server side).
I hope this clarifies. I'm in a different timezone, so if you have further questions on this, other team members like @WilliamBergamin can help you out during my night time.
I am building an app and encountered a problem where slack would not retry failed requests, because the app sends 200 in response. How do i get the app to send 500 or 404 for the requests my app failed to process, so that they could be retried? Or the only is to use inbox pattern?
Reproducible in fastapi:
The
slack_bolt
versionslack-bolt==1.18.1 slack_sdk==3.27.0
Python runtime version
3.12
I guess it happens somewhere over here slack_bolt/listener/thread_runner.py" 198L, as auto acknowledgement is True, but the default error handler does nothing
if i change the line here, then it works as expected