Skip to content

fix(telegram): bind callback confirmations#2222

Merged
esengine merged 2 commits into
esengine:mainfrom
PorunC:feature/telegram-callback-confirmation-ids
May 29, 2026
Merged

fix(telegram): bind callback confirmations#2222
esengine merged 2 commits into
esengine:mainfrom
PorunC:feature/telegram-callback-confirmation-ids

Conversation

@PorunC

@PorunC PorunC commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Bind Telegram inline-button callback data to a confirmation id instead of using bare "1", "2", "3" payloads.
  • Correlate Telegram callback presses with the active confirmation message_id, so stale buttons from older confirmations cannot resolve a newer prompt.
  • Add Telegram setup docs in English and Chinese.

Review Follow-up

This resolves the non-blocking follow-up from #2213 (review):

  • confirmation callbackData now includes a confirmation id (tg:<id>:<choice>)
  • callback presses are accepted only from the currently active Telegram confirmation message
  • stale callbacks, including old buttons after a restart, are ignored

Verification

  • npm run verify

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This addresses both follow-ups I raised on #2213, and cleanly. Callback data is now tg:${confirmationId}:${choice} (via telegramCallbackData/parseTelegramCallbackData) instead of bare "1", and presses are gated twice: callback.confirmationId !== interactionRef.current.confirmationId rejects a button from a superseded confirmation, and query.message.message_id !== this.activeCallbackMessageId correlates the press to the active prompt — so a stale button can't resolve a newer confirmation. The fail-closed acceptRemoteInput(userId) gate on the callback path is preserved. CI green. Nice hardening — merging.

@esengine esengine merged commit 583054f into esengine:main May 29, 2026
4 checks passed
@PorunC PorunC deleted the feature/telegram-callback-confirmation-ids branch May 29, 2026 05:02
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

Successfully merging this pull request may close these issues.

2 participants