fix(telegram): request guest_message in allowed_updates for guest mode - #68061
Closed
elphamale wants to merge 1 commit into
Closed
fix(telegram): request guest_message in allowed_updates for guest mode#68061elphamale wants to merge 1 commit into
elphamale wants to merge 1 commit into
Conversation
PTB's Update.ALL_TYPES is a hardcoded enumeration of update kinds PTB has a typed field for. Bot API 10.0's guest_message isn't one of them (see _handle_guest_message_update's docstring — PTB doesn't have a typed field for it yet, the raw payload arrives via update.api_kwargs["guest_message"]). Passing Update.ALL_TYPES verbatim as allowed_updates to start_polling()/start_webhook() tells Telegram to send every OTHER update type and drop guest_message server-side, before it ever reaches this process. The _handle_guest_message_update TypeHandler registers without error and no exception fires anywhere — the bot just silently never receives a guest @mention, from any chat, indistinguishable from an outage. Confirmed live via getWebhookInfo: allowed_updates was missing guest_message even though getMe reported supports_guest_queries: true. Fixes it by explicitly appending "guest_message" to the allowed_updates list at both call sites (polling and webhook), getattr-guarded since some tests inject a minimal fake `telegram` module (Update = object) that has no ALL_TYPES attribute. No test coverage existed for allowed_updates at all before this, which is how it shipped unnoticed; added a regression test pinning both the constant's content and that no call site bypasses it.
Author
|
Folded into #56476 (the PR whose own commit introduced the gap this fixes — see that PR's own commit history for the fixup) rather than shipping the feature broken and following up separately. #56477 rebased on top to keep the stack intact. Closing this one. |
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.
Summary
Test plan