zendesk / sunshine-conversations-ruby

Smooch API Library for Ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

duplicate or queued responses?

angelacode opened this issue · comments

Hi, I have noticed intermittently that sometimes messenger acts as if it is responding to the same input multiple times. And it looks when I check the webhook that multiple entries are flowing through.

What causes this and is there something that can prevent the queuing when something has successfully been read and an output has been returned through the smooch API?

Webhooks will automatically retry if your server returns certain errors, or fails to respond. Check out our retry policy. Are you doing any type of processing in your webhook handler that could cause a delay before returning 200 OK?

Hi, I had thought of that. I use Runscope to tell the response posting to my webhook URL and the response time.

All 200 and < 15 seconds, average 8 seconds.

Is it typically the longer requests that end up duplicated? Do you know?

It's possible that network latency + external factors could time out the request even though you report a < 20s response time on your server. I would suggest returning 200 OK immediately when the payload is received by your server, and processing the request in the background somewhere. If that doesn't work, if you have specific instances (timestamps or message ids, as well as your Smooch app id) that I can take a look at, I can dig a bit deeper to see what error is returned on our side