Replies: 2 comments
-
Since you have verified the update_ids are incrementing, there's nothing Telegraf can do about it. We're undoubtedly receiving new updates from Telegram. If you have tested and the issue only happens on iOS (and at least not on one of tdesktop, Telegram, Android, Telegram Web, or MacOS Telegram), and only under specific conditions, then you should consider raising an issue over at the Telegram iOS repo: https://github.com/TelegramMessenger/Telegram-iOS. It may be a bug with the client app. |
Beta Was this translation helpful? Give feedback.
-
Hi, Thank you for your reply. I'll be testing some more and get back to you with results. I'm wondering if maybe I cause Telegram to get in a "strange" state by the way I do things although all I do is handle actions associated with items via bot.action. I don't think that any way of doing things should cause Telegram to send new updates when the user does not interact with the chat, but who knows. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a very strange problem with new requests coming in from Telegram when the users switch tasks on an iOS device.
The use case is like this:
They press a button from an inline keyboard that is associated with a bot.action which implements a simple ctx.reply('Hello');.
After pressing the button, the user switches tasks to some other iOS app and then returns to Telegram (with the chat being opened.)
At this point, on some devices Telegram sends NEW requests (with incrementing update_id's) of the last button pressed so I keep on seeing "Hello", "Hello", repeating and after about 10 messages it stops.
I've checked the update_id's of the incoming requests at the server level and again, they are not the same (i.e., they are sequential with each update_id increasing), they are not duplicates, rather they are new incoming requests without anyone pressing anything.
Also, the action repeated is always the last action performed before switching tasks.
The only solution that I have found to get rid of this problem is to delete the chat with the bot and start a new chat, then the problem goes away.
If they first switch to a different chat in Telegram before changing tasks and then coming back into Telegram and going back to the bot chat, the issue does not happen. It is only when they switch tasks with the bot chat left opened and only on some devices. I've used the exact same steps on multiple devices and only about 2 out of 10 devices exhibit this and only on iOS.
My app is a node js app. I am using Telegraf with a Webhook.
My server has an Apache Webserver with ReverseProxy for an Express Server.
The Express server posts a 200 response immediately as the request comes in just to make sure that it is not an issue with delayed responses (although again, the update_id's of each request are different so it is not the 'not sending 200 so telegram repeats the request' issue.
Then, it just does a post with the request to the bot. The Apache web server, express and bot run on the same machine.
I've tried removing the express from the equation but I get the exact same behaviour.
Does anyone have any ideas or at least some hints of what to do?
Thanks!
node js v17.9.0; Telegraf v.4.15.3
Beta Was this translation helpful? Give feedback.
All reactions