Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions repeating multiple times despite single button press (unique update_ids) #699

Open
sudovag3 opened this issue Jan 18, 2025 · 1 comment

Comments

@sudovag3
Copy link

Good evening! We're facing a serious issue with our Telegram bot: clients are complaining that a certain action is repeated multiple times, even though they have pressed the corresponding button only once.

Initially, we suspected a bug in our code. To investigate, we enabled extensive logging of all user actions. Our bot operates via webhooks. When the issue occurred again, the logs showed that each user action had a unique update_id. Therefore, it appears there is no error in our code logic.

However, the user insists that they only pressed the button once (triggering one update), then closed Telegram. When they reopened the app, the action repeated itself without any additional input from the user.

I have a couple of questions:

  • Has anyone encountered a similar problem? If so, how did you resolve it?
  • Am I correct in understanding that the update_id is generated on Telegram’s side and is meant to uniquely identify user actions relative to the bot?

I would really appreciate any insights or suggestions on this matter. Thank you in advance for your help!

@levlam
Copy link
Contributor

levlam commented Jan 18, 2025

The update_id uniquely identifies a callback query request from the user's app.

If the user closed the app before it received response to the callback query, then the app must re-sent the query again after network connection is established to receive the response. This implies that bots can receive the query multiple times. This happens often for callback queries from iOS app users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants