-
Notifications
You must be signed in to change notification settings - Fork 255
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
How do I handle several retried events only once? #868
Comments
Hi @haithcockce thanks for writing in 💯 Bolt python provides a way to Acknowledge a request through the here is an example @app.event('message')
def sample_action_callback(ack: Ack, client: WebClient, logger: Logger):
try:
ack()
client.chat_postMessage...
...
except Exception as e:
logger.error(e) |
@haithcockce To ignore retried requests, you can check the existence of the following in your global middlware or listener functions:
|
@WilliamBergamin Thank you for that! I will keep this in mind should I need it at some point. @seratch Thank you! I will dig into the |
Something is definitely strange with Using this middleware setup, it works as expected and messages do not replay:
If anything in the middleware takes longer than 3 seconds, all messages will replay multiple times:
The I have also found mentions that there is a value that can be parsed to bypass retries, but these values do not seem to be valid. This function always returns |
Spent some more time on this tonight. I think the issue is trying to |
Based on the definition of the Middleware Hope this helps! |
👋 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. |
As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number. |
Hey all, thank you for all the work on this python client. It definitely makes scripting a slackbot really easy.
I have an occasional issue where my slack bolt app receives an event after the 3 second timeout causing the app to receive the same event multiple times. This occurs as well for basic things such as someone asking my app to post a slack message with a basic help message (IE quite truly just replying back with some basic strings). I can confirm this timing by enabling debugging logging.
How do I go about acknowledging an event once and ignoring the retries in the event this happens?
Some additional context;
@app.event('message')
Reproducible in:
The
slack_bolt
versionslack-bolt==1.16.1
Python runtime version
Python 3.10.6
OS info
Fedora 35
The text was updated successfully, but these errors were encountered: