/send/link only produces a small link preview — high-res thumbnail (MediaLinkThumbnail) is not uploaded
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Inizia da pkg/sendMessage/service/send_service.go, in sendLinkWithRetry, quindi segui il wrapper interno SendMessage per vedere come è possibile passare SendRequestExtra.MediaHandle. Usa il flusso di upload whatsmeow esistente con MediaLinkThumbnail e imposta su ExtendedTextMessage i campi della miniatura restituiti e il tipo di anteprima dell’immagine. Il lavoro è completato quando POST /send/link esegue il rendering della scheda del link ad alta risoluzione mantenendo il fallback JPEG di piccole dimensioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Welcome!
- Yes, I have searched for similar issues on GitHub and found none.
What did you do?
I sent a message through POST /send/link with a real URL and an OG image, expecting the big rich link-preview card you get when a normal user pastes a link into WhatsApp. The imgUrl is populated (or auto-fetched from the page metadata).
Roughly this body:
{
"number": "<group>@g.us",
"text": "…summary text… https://example.com/trail",
"url": "https://example.com/trail",
"title": "…",
"description": "…",
"imgUrl": "https://example.com/image-1200x630.jpg"
}
What did you expect?
A large link-preview card — the OG image rendered big at the top of the message, tapping through to the URL.
It reproduces every time. The image loads fine, so this is specifically about the large-vs-small render path (the missing MediaLinkThumbnail upload), not the image failing to show.
What did you observe instead of what you expected?
Only the small preview shows up: a little thumbnail on the left side, no matter how large the OG image is. So it works, it's just always the small variant.
The image itself embeds fine — I checked the outgoing message and it carries the full 1200×630 image as a ~297 KB JPEGThumbnail. WhatsApp just renders it small.
The reason is in sendLinkWithRetry (pkg/sendMessage/service/send_service.go, around lines 754–762). The ExtendedTextMessage is built with only the inline thumbnail:
previewType := waE2E.ExtendedTextMessage_VIDEO
msg := &waE2E.Message{
ExtendedTextMessage: &waE2E.ExtendedTextMessage{
Text: &data.Text,
Title: &data.Title,
MatchedText: &matchedText,
JPEGThumbnail: fileData,
Description: &data.Description,
PreviewType: &previewType,
},
}
Two things stand out. First, it never uploads a high-res link thumbnail, so ThumbnailDirectPath, ThumbnailSHA256, ThumbnailEncSHA256, ThumbnailWidth and ThumbnailHeight are all unset — and those fields (plus the MediaHandle on send) are exactly what WhatsApp needs to render the large card. An inline JPEGThumbnail on its own always renders small, at any resolution. Second, PreviewType is hardcoded to VIDEO for what are image links, even though the enum has a dedicated IMAGE (5).
Screenshots/Videos
No response
Which version are you using?
0.7.1
What is your environment?
Docker
If applicable, paste the log output
Here's the outgoing message (trimmed) from a POST /send/link call:
Info.Type: "ExtendedTextMessage"
Message.extendedTextMessage:
matchedText: "https://example.com/trail"
title: "…"
description: "…"
previewType: 1 # VIDEO
JPEGThumbnail: <~297 KB, 1200×630 jpeg>
# thumbnailDirectPath / thumbnailSha256 / thumbnailEncSha256 /
# thumbnailWidth / thumbnailHeight — all absent
# no MediaHandle passed on send
Additional Notes
Suggested Fix:
Happy to Contribute.
The gist is to upload the fetched image as a link thumbnail and wire the returned fields onto the message:
up, err := client.Upload(ctx, fileData, whatsmeow.MediaLinkThumbnail)
// then on the ExtendedTextMessage:
// ThumbnailDirectPath = &up.DirectPath
// ThumbnailSHA256 = up.FileSHA256
// ThumbnailEncSHA256 = up.FileEncSHA256
// ThumbnailWidth/Height = <decoded dims>
// JpegThumbnail = <small ~100px jpeg> // keep for the fallback
// PreviewType = IMAGE
…and pass the upload handle through on send:
client.SendMessage(ctx, jid, msg, whatsmeow.SendRequestExtra{ MediaHandle: up.Handle })
This will probably mean threading SendRequestExtra.MediaHandle through the internal SendMessage wrapper, which doesn't currently expose it.
- Lingua principale
- Go
- Stelle
- 929
- Fork
- 499
- Merge medio
- 5m
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di evolution-foundation/evolution-go
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
evolution-foundation/evolution-go#193 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
evolution-foundation/evolution-go#104 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
evolution-foundation/evolution-go#101 ·
I maintainer di solito rispondono entro 1 giorno
-
POST /group/participant always returns 400 "participants is required and cannot be empty" (wrong validation middleware on route)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
evolution-foundation/evolution-go#97 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
evolution-foundation/evolution-go#219 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di evolution-foundation/evolution-go
Issue simili
-
Docs: how to get more careful answers (Effort, reasoning models, Reasoning level, Deliberate)Apertadocumentation priority:p1
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
yeixio/toskar-core#697 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
keyxmakerx/Chronicle#1532 ·
I maintainer di solito rispondono entro 1 giorno
-
The acquisition fixture's search path skips the argument table production enforces (regression from #285)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Judgment-Pack/judgment-pack-gateway#293 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: 【优化】对话消息底部增加发送时间展示Apertabug desktop v3 windows
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
esengine/DeepSeek-Reasonix#13697 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue help wanted
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
eugenioenko/ttt#959 ·
I maintainer di solito rispondono entro 1 giorno