-
Notifications
You must be signed in to change notification settings - Fork 378
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 workflow step execution sample code to not await the workflowSteps Slack API responses #1178
Conversation
…s Slack API responses (as these may take 3+ seconds), which may lead to Event API payloads not being responded to in time. Fixes #1156.
Codecov Report
@@ Coverage Diff @@
## main #1178 +/- ##
==========================================
- Coverage 71.83% 71.33% -0.51%
==========================================
Files 15 17 +2
Lines 1360 1399 +39
Branches 405 415 +10
==========================================
+ Hits 977 998 +21
- Misses 312 331 +19
+ Partials 71 70 -1
Continue to review full report at Codecov.
|
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.
LGTM! Nice find dude!
@filmaj One thing I would like to mention for people that will visit this page in the future is that, if you don't run your apps with Also, I left a comment to the linked issue: #1156 (comment) |
@seratch is this true? I think one complicating factor about the For example, when using the For the situation in #1156, the users were using the |
@filmaj I mentioned the default behavior. With the default settings, processBeforeResponse is false. The AWS Lambda receiver is an exception. It works only with the true option. |
@seratch I see, you are right of course, the workflow examples apply to all different kinds of Receivers with |
Co-authored-by: Kazuhiro Sera <ksera@slack-corp.com>
…ies in event processing when using the processBeforeResponse option.
I expanded on your suggestions @seratch. What do you think? I was also trying to see if perhaps the AWS Deployment guide in the docs should be updated to specifically mention this issue, but couldn't think of how to naturally incorporate that into the structure of the document. Alternatively, perhaps the "Workflow steps" document introduction could use a clarifying section discussing how the workfow step event handlers need to be kept performant when used in conjunction with |
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.
Thanks for updating the comments!
@filmaj All good 👍 I just added a suggestion on the Japanese comment. Can you have the change as well before merging this PR? |
Co-authored-by: Kazuhiro Sera <ksera@slack-corp.com>
Since the
workflowSteps.completed
API may take 3+ seconds to respond, with our existing sample code on how to write workflow step execution handlers, this may lead users' apps to not respond to Event API payloads within the required 3 seconds time.This PR fixes #1156 by not awaiting the Slack API response for the workflow step completed/failure callbacks, freeing up the event handling loop in Bolt to respond in time.