fix: support gif media type in downloads#274
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 7, 2026, 8:08 PM ET / 00:08 UTC. Summary Reproducibility: yes. with source inspection and the contributor's redacted terminal proof: current main stores gif labels but rejects them before download. I did not run a live WhatsApp download in this read-only review. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land the narrow Do we have a high-confidence way to reproduce the issue? Yes, with source inspection and the contributor's redacted terminal proof: current main stores gif labels but rejects them before download. I did not run a live WhatsApp download in this read-only review. Is this the best way to solve the issue? Yes, mapping AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against be2d22fe9d8c. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Reopened — this was auto-closed by GitHub's cross-repo closing-keyword parsing (a PR description elsewhere contained "fix: #274" and closed this on merge). Not intentional; the fix stands as proposed. |
extractMedia labels video messages that have the gif-playback hint as media_type "gif", but MediaTypeFromString had no case for it. Every gif therefore failed both `wacli media download` and the background `sync --download-media` workers with "unsupported media type: gif" before any network request was made. Map "gif" to whatsmeow.MediaVideo: WhatsApp gifs are stored and encrypted as regular videos (same precedent as sticker -> MediaImage). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9116ff7 to
ac18283
Compare
steipete
left a comment
There was a problem hiding this comment.
Reviewed implementation and maintainer follow-up. GIF playback videos keep the stored media_type label as gif, while download and decrypt use WhatsApp video media keys; local tests cover direct download, hashes, decrypt, and MMS mapping.
|
Maintainer proof after rebasing onto current main and adding the maintainer test/changelog commit.
Autoreview:
|
Problem
extractMedialabels video messages carrying the gif-playback hint as media_type"gif", butMediaTypeFromStringhas no case for it. As a result every gif fails media download — both viawacli media downloadand via the background workers ofsync --download-media— withunsupported media type: gif, before any network request is made.local_pathnever gets set for these messages.Fix
Map
"gif"towhatsmeow.MediaVideo: WhatsApp gifs are stored and encrypted as regular videos (the gif flag is only a playback hint). Same label-remap precedent as"sticker"→MediaImagein the same switch.Real behavior proof
Before/after run against a real gif message that the background downloader had skipped (
media downloadin--read-onlydirect-download mode; same store, same message, run back to back; group JID and message id redacted):wacli-main= built from currentmain(be2d22f);wacli-pr=main+ this PR (9116ff7). Only this PR's 2-file diff differs between the binaries.file_lengthexactly, and the direct-download path verifiesfile_sha256internally before writing — so this is the original media, decrypted correctly with the video key type.giflabel rather than network flakiness.Test
Extended
TestMediaTypeFromStringto assert the resolvedwhatsmeow.MediaTypefor every supported label, includinggif→MediaVideo. The new assertion fails onmainwithunsupported media type: gifand passes with this change. Full suite (go build ./... && go vet ./... && go test ./...) is green.🤖 Generated with Claude Code