I have two if statements the following are examples.
1: if webhookto =sellerNumber
Then create record in communication app
2: if webhookto =secondSellerNumber
Then create record to communication app
It keeps logging to the app twice it should only log once
I did a console.log to make sure vars are correct. vars are fine. I even tried doing an else. still duplicate logging.
This is very wierd I dont understand why this is going on can someone please help. It appears to be a tape bug.
I noticed the webhook is firing twice this is wierd as this was not happening earlier and I checked to see if twilio is sending multipule hooks that appears not to be the case.
It is confirmed the issue is the webhook is firing twice. I need someone to assit me with this please.
Update this is the response from Twilio help center.
Twilio Retries: If your webhook endpoint does not respond with a 2xx HTTP status code promptly, Twilio will retry the request, which could look like duplicated events.
Obviously @buildingwealth has been having an issue here so i don’t want to detract from that fact, however I have a lot of automations that receive webhooks from lots of different places and I hadn’t noticed any issues, so I wanted to run some tests to do this I built a little webapp that takes a URL and sends a message to it then displays the response code along with the time interval between send and receive. I then tested three different Tape Webhooks across two different organisations and also tested against a webhook on one of my other servers, the video shows one of the Tape webhook tests the first send in the video was by far the slowest response of any of my tests but at only 139ms which I would have thought was perfectly acceptable (I would be happy with anything sub 300ms). All my other tests were sub 100ms and were comparable to my server I ran tests on.
I am not sure were that leaves you but if you are still getting the issue then I am unconvinced it is due to a slow response from Tape.
If you want to test your webhooks response time then I will leave the worker up for a while and you can get to it here: https://webhook-tester.jmc.tools/ and if I can help you further then feel free to DM me with any further information if you can’t post it for the world to see.
Thanks @Jason as @1F2Ns said you really are the MVP I’m glad we have the response time sorted and I’m glad that’s not the issue. I’m going to do some more debugging and hopefully I can come up with a solution. One thing that I did try, was creating a new webhook then passing that new hook to Twilio, but it appears the hook was still getting hit twice. It may be a Twilio issue. The wierd thing is the webhook was working as expected earlier. I’ll keep you guys updated and let you know what the problem is after I do some more debugging.
After some more debugging I found out what the issue is. It’s not a Tape a bug. Tape is working as expected
Twilio is triggering my webhook twice. Once for messageStatus sent and once for message delivered. The reason I had it working earlier is that I had a conditional in place to only update a record if the message was delivered. I must of removed the conditional without noticing. I was very exhausted when I was facing the problem. I probably should of did some more debugging before creating this thread. My apologies it was 100 percent my fault. Next time I will thourghly debug before I ask for help.