fix(telegram): resolve channel_post media updates via effective message normalization - #29753
Closed
Sylw3ster wants to merge 1 commit into
Closed
Conversation
Collaborator
Contributor
Author
|
dublicate |
1 task
This was referenced Jun 23, 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.
What does this PR do?
This PR fixes a missed Telegram
channel_postcode path for media messages.In Telegram, channel broadcasts arrive as
Update.channel_postrather thanUpdate.message. PR704872a62introduced_effective_update_message()and updated the text/command/location handlers to use it, but_handle_media_message()was still readingupdate.messagedirectly. As a result, channel-post media updates (for example stickers, photos, videos, audio, voice notes, and documents) could be silently ignored before aMessageEventwas ever built.The fix keeps the existing behavior and simply aligns the media handler with the same invariant already established for the sibling handlers: normalize the incoming update through
effective_messagefirst, then process it normally. This is the smallest behavior-preserving fix and directly addresses the broken path without changing unrelated Telegram media logic.Related Issue
Fixes #
Type of Change
Changes Made
gateway/platforms/telegram.pyso_handle_media_message()uses_effective_update_message(update)instead of readingupdate.messagedirectly.tests/gateway/test_telegram_channel_posts.pycovering achannel_postmedia message and asserting it is routed through the media handler instead of being dropped.How to Test
_handle_media_message(). Before this fix, the handler could return early becauseupdate.messageisNoneforchannel_postupdates.scripts/run_tests.sh tests/gateway/test_telegram_channel_posts.py -quv run --extra dev pytest tests/gateway/test_telegram_channel_posts.py -q -n 0 --timeout-method=threadChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passScreenshots / Logs
Local targeted verification passed: