Repository navigation
Conversation
A bot's ephemeral reply to a callback button can arrive as updateShort, which carries no users. The sender, receiver and reply peers were all required by verifyTransaction, so an unknown bot made the whole update batch fail. The fallback getDifference never returns ephemeral messages, so the message was lost until the user opened the bot once. Only require the chat peer for ephemeral updates, as Android and Desktop do.
sultannoura99-rgb
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://bugs.telegram.org/c/67210: tapping a bot's button under a channel post does nothing unless you have opened that bot before. The bot gets the callback and
sendMessagewith ephemeral parameters returns ok, but the ephemeral message never appears. Searching for the bot once fixes it. Android and Desktop show it every time.Cause
The server sends the bot's reply as
updateShort(updateNewEphemeralMessage).updateShortcarries no users, so the bot's user record isn't included.apiEphemeralMessagePeerIdsadded the sender, the receiver and the reply peers to the peer ids of the update.verifyTransactionrequires every one of them to be stored locally. With an unknown bot it fails, the whole update batch is dropped, and the client falls back to getDifference, as it does for regular messages. getDifference never returns ephemeral messages, so this one is lost.From the reporter's log (13.1.1, channel 3824268692, bot 9120613204):
The same three lines repeat on every tap.
Change
apiEphemeralMessagePeerIdsnow returns only the chat the message belongs to (Api.EphemeralMessage.peerId). It is used only forupdateNewEphemeralMessageandupdateEditEphemeralMessage. Regular messages, other updates in the same batch andverifyTransactionitself are unchanged, and an unknown chat still fails the check as before.This matches the other clients. Android passes
updateShortstraight toprocessUpdateArray, andEphemeralUpdates.applynever looks up users. Desktop passes it tofeedUpdate, andEphemeralMessages::applyOrDeferonly waits for a missing ephemeral reply target, never for a user.When the bot isn't stored locally, the message is shown without it: the "via bot" badge falls back to "bot", and a standalone ephemeral bubble in a group has no author name. The bot stays unknown until the user opens it, because the update has no access hash to fetch it with. Android and Desktop have the same limit.
Testing
Simulator (iPhone 17e, iOS 27), debug build, account freshly signed in that never opened @BugTelegramDemoBot: opened @bruninoittest, joined it, tapped "unlock it". The post was replaced with "the post is now unlocked". The log shows the same
updateShortwith nomissing peers/failed to verify final state. Not tested on a device.