Bot replies twice when Lambda cold starts
See original GitHub issueDescription
I have setup a Slack Bolt on AWS Lambda by following this instruction - https://slack.dev/bolt-js/deployments/aws-lambda#set-up-aws-lambda
I want the Bot to reply ‘hi’ if someone says ‘help’. Sample code:
app.message('help', async ({ message, say }) => {
await say(`hi`);
});
I noticed that whenever the Lambda is cold, the Bot always says hi twice. But when Lambda is warm, the Bot only replies once. What is the possible solution to prevent the Bot from answering it twice when Lambda cold starts. Thanks!
What type of issue is this? (place an x
in one of the [ ]
)
- bug
- enhancement (feature request)
- question
- documentation related
- example code related
- testing related
- discussion
Requirements (place an x
in each of the [ ]
)
- I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
- I’ve read and agree to the Code of Conduct.
- I’ve searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version:
"@slack/bolt": "^3.2.0",
"@vendia/serverless-express": "^4.3.3",
node version: v12.14.1
Environment: AWS Lambda
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Spring Boot Lambda Startup multiple times at the cold start
I deployed it in the AWS lambda function. At the cold starting each time it initializes twice as shown in the image below....
Read more >Reflection: AWS Lambda Functions + Slack Bolt | by Yan Kai Lim
When deployed on Lambda, our bot replies 'Hello <name>' twice. The reason for this is because Slack expects a response from the bot...
Read more >Lambda Cold Starts, A Language Comparison ❄️ (2018)
Cold Start ? A 'cold' start in the serverless world, is the first time in some set period where a request asks for...
Read more >Your Lambda function might execute twice. Be prepared!
Are you confused when scheduled Lambdas execute twice, SNS messages trigger an invocation three times, your handmade S3 inventory is out of ...
Read more >Optimizing your Lambda cold starts with serverless-webpack
Some of your npm dependencies may exist twice because they are referenced by multiple modules. A bundler can follow the dependency graph into...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jc1518 Yes, your idea sounds a great approach to me 👍
Hi @mwbrooks ,
Thanks for the quick response. Yes, I have the
processBeforeResponse: true
settings. I am thinking this issue could be caused by the Lambda concurrent execution? When Lambda cold starts, it may trigger more than one execution.