Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

/send/link only produces a small link preview — high-res thumbnail (MediaLinkThumbnail) is not uploaded

Aperta
#103 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@cateim ci sta già lavorando.

Dal 26/9/2026.

  • #207 di @cateim — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
go
Ambito
api, backend

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

bug
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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di evolution-foundation/evolution-go

Tutte le issue di evolution-foundation/evolution-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.