Neurotech-HQ/heyoo

Webhook subscription sending old messages

gtavo95 opened this issue · 3 comments

I was testing the webhook example, everything works fine but I am still receiving old messages. I wonder if this is the normal functioning?

I send a message from my phone (e.i Hi) and then I receive multiple times the message on my webhook:

2022-08-21 10:35:47,046 - root - INFO - New Message; sender:xxxxxxx86 name:Gustavo Gordillo type:text
2022-08-21 10:35:47,257 - werkzeug - INFO - 127.0.0.1 - - [21/Aug/2022 10:35:47] "POST /conversations/webhook HTTP/1.1" 200
2022-08-21 10:35:48,854 - root - INFO - New Message; sender:xxxxxxx86 name:Gustavo Gordillo type:text
2022-08-21 10:35:48,982 - werkzeug - INFO - 127.0.0.1 - - [21/Aug/2022 10:35:48] "POST /conversations/webhook HTTP/1.1" 200
2022-08-21 10:35:50,898 - root - INFO - New Message; sender:xxxxxxx86 name:Gustavo Gordillo type:text
2022-08-21 10:35:51,040 - werkzeug - INFO - 127.0.0.1 - - [21/Aug/2022 10:35:51] "POST /conversations/webhook HTTP/1.1" 200
2022-08-21 10:35:51,514 - root - INFO - New Message; sender:xxxxxxx86 name:Gustavo Gordillo type:text

At the end of the script I am sending a return "ok" (as in the example).

PD: amazing project! :)

Hi @gtavo95, I too experienced this issue and most of the time is due to the fact that uncached exception is raised so 500 (Internal server error) returned to WhatsApp cloud API but also sometimes it arises when you have two webhook using the same phone number ID

Can you please take a look at those and let us know if they help you fix the issue?

Thanks both of you for your responses. I had two webhooks using the same phone number ID as @Kalebu said.

hi, I have the same issue but I have only one webhook with my phone id.
Is return "ok" is good?
or need return OK,200 ?
also, do return ok also for status messages that called the webhook? or only to "real" messages ?