fix(telegram): handle channel_post media via effective_message - #28614
fix(telegram): handle channel_post media via effective_message#28614soynchux wants to merge 1 commit into
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused Telegram fix. I checked this against current origin/main (29c6985590043fc672a6c9a7cdb9a8695388d1ac), and the premise still holds.
Problems
- Current main still returns early in
gateway/platforms/telegram.py:5995whenupdate.messageis absent, so Telegramchannel_postmedia can be dropped before aMessageEventis built. - The media handler has gained an observed-unmentioned-group branch on current main at
gateway/platforms/telegram.py:5997-6007; when this is salvaged, that branch also needs to use the normalizedmsg, notupdate.message.
Suggested changes
- Apply the same
_effective_update_message(update)normalization throughout_handle_media_message(): the early guard,_should_process_message, the observe branch, and the final media-processing path. - Keep the added regression test from
tests/gateway/test_telegram_channel_posts.py; it covers the right behavior for channel-post photo delivery.
Automated hermes-sweeper review; humans decide final salvage/merge.
| if not msg: | ||
| return | ||
| if not self._should_process_message(update.message): | ||
| if not self._should_process_message(msg): |
There was a problem hiding this comment.
When this is salvaged onto current main, carry this normalized msg through the current observed-unmentioned-group branch too; that branch now still reads update.message, which is also None for channel_post updates.
|
Thanks for the focused Telegram regression fix. The underlying issue still exists on current main, but the adapter was subsequently moved and gained additional intake guards. Problems
Suggested changes
Automated hermes-sweeper review; humans decide final salvage/merge. |
Summary
Fix Telegram
channel_postmedia handling so channel photo/media posts are routed through the sameeffective_messagepath already used by text and command updates.Previously
_handle_media_message()read fromupdate.message, which isNoneforUpdate.channel_post, causing channel media posts to be silently ignored.Changes
effective_messageUpdate.channel_postTest
pytest tests/gateway/test_telegram_channel_posts.py -qResult:
4 passed in 5.79s