Repository navigation
Decode handler updates with the shared Telegram compatibility fixes - #310
Merged
Merged
Conversation
The update handler decoded raw payloads with its own serde call, so it skipped decode_telegram_update_value. GIF messages still reached history and the dialog as Document/video attachments and went to ASR, while the materializer already labelled the same files as animations. Run the handler's own payload fixes, then the shared decoder. Besides the animation mirror, this applies the poll-answer voter_chat and legacy administrator-rights fixes the materializer already uses.
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.
Problem
After #309 was deployed (2026-11-27 14:31Z),
telegram_fileslabelled GIFs asanimation, but 4 GIFs still went to ASR within 15 minutes (asr-api answeredno_audio_stream, the bot storedno audio stream). Their history entries hadkind: videowithout width or duration, which only the Document branch produces.The update handler (
updates.rs, the materialized-update claim path, plusdialog_toolspayload reads) decodes raw payloads with its owndecode_telegram_update_payload. That function applied two local fixes and then calledserde_json::from_valuedirectly, so it never randecode_telegram_update_valueand its animation/document fix. The materializer, which writestelegram_files, uses the shared decoder, so the two paths disagreed.Change
decode_telegram_update_payloadkeeps its local fixes (legacy forward fields, sender chat) and then callsopenplotva_updates::decode_telegram_update_value. Besides the animation mirror, the handler now also gets the poll-answervoter_chatand legacy administrator-rights fixes that the materializer already applies, so both paths decode the same update the same way.Checks
cargo fmt --allcargo clippy --workspace --all-targets -- -D warningsgif_animation_history_keeps_animation_kind: a raw update withanimation+documentdecodes toMessageData::Animation, and the persisted history entry has attachment kind and message typeanimation.cargo test -p openplotva-app --lib -p openplotva-telegram -p openplotva-updates: 1480 + 241 + 94 passed.