I was trying setup AWS Lambda as a webhook for my messenger bot. I use Python 3.6 to build the handler.
Everything was ok if webhook returns 3 to 4 messenges. When the webhook sends to messenger bot more than 10 messages, this created infinite loop. I have to unsubscribe the bot to make it stop.
One more thing, I built another flask server and use ngrok to test it, everything was ok. There aren't infinite loop no matter how many messages were created
How do I stop it ? I suspect the problem came from AWS Lambda. Thanks!
I already found the problem. The loop happens because the delay time of Lambda. It took too long to process the request, so during this time, facebook messenger continue to POST request to webhook server