S3 enabled: messageContextInfo guard aborts the whole upsert pipeline - no MESSAGES_UPSERT webhook for media (v2.3.7)
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 56/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- aws, node.js, postgresql, redis, typescript
Hướng nghiên cứu
The issue names whatsapp.baileys.service.js and describes two early returns in the media processing path when S3 is enabled. Read the upsert flow around the messageContextInfo guard and getBase64FromMediaMessage call, then trace where messages.upsert is emitted. Done means those media cases still emit the webhook when upload is skipped; check the existing related tests or add coverage for both scenarios.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Environment
- Evolution API v2.3.7 (Docker
evoapicloud/evolution-api:latest) - S3 storage enabled (Cloudflare R2, S3-compatible endpoint,
S3_SKIP_POLICY=true) - Channel: WhatsApp Baileys, multiple instances on the same server
- DB: PostgreSQL, Redis cache (
CACHE_REDIS_SAVE_INSTANCES=false)
Summary
Since enabling S3_ENABLED=true, media messages that reach an instance either (a) wrapped as a messageContextInfo-only payload, or (b) whose getBase64FromMediaMessage fails, no longer emit messages.upsert webhooks at all. The message row is still saved to the database, but the webhook is never fired. With S3 disabled, the same flows emit webhooks normally — the affected code path only runs when S3 is enabled.
Two user-visible scenarios (both reproduced):
- Document sent via API (
POST /message/sendMedia): the receiving instance receives the message as amessageContextInfo-only wrapper → guard returns → no S3 upload and no webhook. The receiver's integration never sees the message. - Media sent from the linked phone: the sending instance's own
fromMeecho →getBase64FromMediaMessagefails → no upload and no webhook. The sender's integration never registers the outgoing media (onlymessages.updatereceipts arrive).
Evidence (v2.3.7 logs, timestamps local)
Scenario 1 — document sent via API from instance A to instance B (B's webhook received nothing):
[instanceB] VERBOSE [ChannelStartupService] Message contains only messageContextInfo, skipping media processing
[instanceB] VERBOSE [ChannelStartupService] No valid media to upload (messageContextInfo only), skipping MinIO
- No S3 object created under instance B's prefix.
- No
p.sendData-Webhookblock withevent: 'messages.upsert'in the logs for B — onlymessages.updatereceipts from A.
Scenario 2 — photo sent from A's linked phone (A's webhook never got the fromMe upsert):
[instanceA] VERBOSE [ChannelStartupService] No valid media to upload (messageContextInfo only), skipping MinIO
- The receiving instance processed the same message fine (S3 object uploaded + webhook delivered).
- Instance A emitted only
messages.update(SERVER_ACK / DELIVERY_ACK) — nomessages.upsert.
Relevant code (v2.3.7, whatsapp.baileys.service.js)
n.message = n.message[d].message;
if ("messageContextInfo" in n.message && Object.keys(n.message).length === 1)
return this.logger.verbose("Message contains only messageContextInfo, skipping media processing"), null;
...
const D = await this.getBase64FromMediaMessage({ message: b }, true);
if (!D) {
this.logger.verbose("No valid media to upload (messageContextInfo only), skipping MinIO");
return; // ← aborts the rest of the message processing, including webhook emission
}
The guard introduced by the 2.3.7 fix "MinIO Upload: Handle messageContextInfo in media upload to prevent MinIO errors" appears to early-return out of the whole upsert flow instead of skipping only the media upload. Because this code path only executes when S3 is enabled, enabling S3 silently drops messages.upsert webhooks for these messages.
Expected behavior
Skip (or defer) the S3 upload but still emit messages.upsert — e.g. without mediaUrl, or with the original message payload — so integrations keep receiving every message. Ideally, retry the media upload when the real payload arrives after decryption.
Steps to reproduce
- Two instances (different WhatsApp numbers), webhooks enabled for both, S3 enabled.
POST /message/sendMedia(document via URL) from instance A to B's number → B's webhook receives nothing for the document (it arrives on the phone and is saved to B's DB).- Send a photo from A's linked phone to B → A's webhook receives no
fromMeupsert for the photo; B receives it normally. - Disable S3 and repeat → webhooks flow again.
Workaround
None besides disabling S3 (restores the webhook flow) or synthesizing outgoing messages on the integration side from the API send response plus messages.update receipts.
Happy to provide more log excerpts or a live reproduction if needed. Thanks for the great project!
- Ngôn ngữ chính
- TypeScript
- Star
- 10.2k
- Fork
- 7.5k
- Merge trung bình
- 6 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọ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-api
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
evolution-foundation/evolution-api#2796 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
evolution-foundation/evolution-api#2795 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
evolution-foundation/evolution-api#2782 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
evolution-foundation/evolution-api#2723 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
evolution-foundation/evolution-api#2704 ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của evolution-foundation/evolution-api
Issue tương tự
-
[Bug]: Manager UI logo fails to load — broken external URLCó thể đã có người làm @kavindu-udara đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
excalidraw/excalidraw#12743 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: cli priority: P2 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
appandflow/stim#6381 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: ui-kit type: chore
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
schlessera/brain-kit#4598 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue spec
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100