Sending double message after using setWebhook method
vientoquesurcalosmares opened this issue · 1 comments
I have the following problem, I know it is not a problem on the part of this package, what happens is the following:
1.- When I execute the "setWebhook" method for example to the url https://fake.com/telegram-webhook it makes the change well
2.- Then I send a job to a queue that sends a message using the "replyWithMessage" method, "ok" is returned with status 200 and then the job is executed and that message arrives correctly to telegram
3.- If I execute the "setWebhook" method again but to a different url, for example to https://anotherserver.com/telegram-webhook, that change is correct
4.- Then I send another job to a queue that sends another message executing the "replyWithMessage" method, "ok" is returned with status 200 and then the job is executed but here the message arrives 2 times, this is my problem
I am sure that "ok" is always returned with status code 200, I think that when a setWebhook is done, a request to the first url and another to the new url is left pending, has anyone had this same problem and found a solution?
Usually when Telegram doesn't get a 200 status immediately, it retries. Maybe during your change (although why would you even switch like that? and even if you do, it could be a one time issue tho -- unless you keep swapping for whatever reasons) Telegram couldn't get the 200 confirmation and thus, they reattempt.