/send/link only produces a small link preview — high-res thumbnail (MediaLinkThumbnail) is not uploaded
Maintainer thường phản hồi trong vòng 5 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Bắt đầu trong pkg/sendMessage/service/send_service.go tại sendLinkWithRetry, sau đó lần theo wrapper SendMessage nội bộ để xem SendRequestExtra.MediaHandle có thể được truyền qua như thế nào. Sử dụng luồng upload whatsmeow hiện có với MediaLinkThumbnail và gắn các trường thumbnail được trả về cùng kiểu bản xem trước hình ảnh vào ExtendedTextMessage. Hoàn tất khi POST /send/link hiển thị thẻ liên kết độ phân giải cao đồng thời vẫn giữ fallback JPEG nhỏ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 890
- Fork
- 473
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của evolution-foundation/evolution-go
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
evolution-foundation/evolution-go#193 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
evolution-foundation/evolution-go#104 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
evolution-foundation/evolution-go#101 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
evolution-foundation/evolution-go#97 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
evolution-foundation/evolution-go#204 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của evolution-foundation/evolution-go
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
NVIDIA/k8s-device-plugin#2076 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/release kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kubernetes-sigs/kueue#16455 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày