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
fix: add queue for Slack events #1892
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1892 +/- ##
=======================================
Coverage 99.37% 99.37%
=======================================
Files 83 83
Lines 5089 5102 +13
=======================================
+ Hits 5057 5070 +13
Misses 32 32
Continue to review full report at Codecov.
|
f5daab9
to
4c9745e
Compare
4c9745e
to
50f4440
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this fix! Glad you have it working in production!
I'll test the fix later today and will approve later, I've also re-run CI to see if the windows tests pass
"""Disconnect from Slack. | ||
|
||
Cancels the event queue worker task and disconnects the | ||
socket_mode_client if socket mode was enabled.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nitpick, feel free to ignore
socket_mode_client if socket mode was enabled.""" | |
socket_mode_client if socket mode was enabled. | |
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies took me longer than I wished for! Going to approve and merge this MR thank you for fixing the issue 😄 👍
@FabioRosado no worries, thanks for accepting the PR! :) Do you have any estimates when the next opsdroid release is planned? Thanks for your work! |
No worries! We tend to release monthly but we may skip a release if no new things got in. I'll try to get some work done and maybe see if we can release soonish 😄 |
Description
The Slack Events API documentation states:
https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
This PR adds an
asyncio.Queue
which incoming events are pushed into. Theweb_handler
will return HTTP Status 200 to Slack immediately and the event is processed asynchronously in the background.I'm fairly new to async python, so please let me know if there is a more idiomatic way to achieve this and I'll update the PR accordingly.
We're already using this fix in production and so far it works flawlessly.
Fixes #1890
Status
READY
Type of change
How Has This Been Tested?
Checklist: