Skip to content

Decode handler updates with the shared Telegram compatibility fixes - #310

Merged
iamwavecut merged 1 commit into
mainfrom
fix/gif-animation-handler-decode
Nov 27, 2026
Merged

iamwavecut merged 1 commit into
mainfrom
fix/gif-animation-handler-decode

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

Problem

After #309 was deployed (2026-11-27 14:31Z), telegram_files labelled GIFs as animation, but 4 GIFs still went to ASR within 15 minutes (asr-api answered no_audio_stream, the bot stored no audio stream). Their history entries had kind: video without width or duration, which only the Document branch produces.

The update handler (updates.rs, the materialized-update claim path, plus dialog_tools payload reads) decodes raw payloads with its own decode_telegram_update_payload. That function applied two local fixes and then called serde_json::from_value directly, so it never ran decode_telegram_update_value and its animation/document fix. The materializer, which writes telegram_files, uses the shared decoder, so the two paths disagreed.

Change

decode_telegram_update_payload keeps its local fixes (legacy forward fields, sender chat) and then calls openplotva_updates::decode_telegram_update_value. Besides the animation mirror, the handler now also gets the poll-answer voter_chat and legacy administrator-rights fixes that the materializer already applies, so both paths decode the same update the same way.

Checks

  • cargo fmt --all
  • cargo clippy --workspace --all-targets -- -D warnings
  • New test gif_animation_history_keeps_animation_kind: a raw update with animation + document decodes to MessageData::Animation, and the persisted history entry has attachment kind and message type animation.
  • cargo test -p openplotva-app --lib -p openplotva-telegram -p openplotva-updates: 1480 + 241 + 94 passed.

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.
@github-actions

Copy link
Copy Markdown
Messages
📖 Danger checked 1 changed file(s).

Generated by 🚫 dangerJS against d3090af

@iamwavecut
iamwavecut merged commit 859c2c7 into main Nov 27, 2026
12 checks passed
@iamwavecut
iamwavecut deleted the fix/gif-animation-handler-decode branch November 27, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant