openclaw/src/web
Yachiyo Tsukimido (猫猫) 9d73a63487 fix(whatsapp): use stream mode for media download to fix empty audio buffer
Fixes #4636

## Problem
WhatsApp voice messages (audio/ogg) were being saved as 0-byte files while
image downloads worked correctly. The issue is that Baileys 7.x
`downloadMediaMessage` with "buffer" mode returns empty data for audio
messages.

## Solution
- Changed from "buffer" mode to "stream" mode in `downloadInboundMedia()`
- Manually collect stream chunks and concatenate into buffer
- Added validation to detect and handle empty buffers

## Testing
- Voice messages now download correctly with actual audio data
- Image downloads continue to work as before
- Tested with WhatsApp voice notes (ogg/opus format)

Before fix: 0 bytes
After fix: 11488 bytes (actual audio data)
2026-01-30 21:24:16 +08:00
..
auto-reply refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
inbound fix(whatsapp): use stream mode for media download to fix empty audio buffer 2026-01-30 21:24:16 +08:00
accounts.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
accounts.whatsapp-auth.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
active-listener.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auth-store.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auto-reply.broadcast-groups.broadcasts-sequentially-configured-order.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auto-reply.broadcast-groups.skips-unknown-broadcast-agent-ids-agents-list.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auto-reply.impl.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
auto-reply.partial-reply-gating.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auto-reply.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
auto-reply.typing-controller-idle.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auto-reply.web-auto-reply.compresses-common-formats-jpeg-cap.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auto-reply.web-auto-reply.falls-back-text-media-send-fails.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auto-reply.web-auto-reply.prefixes-body-same-phone-marker-from.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auto-reply.web-auto-reply.reconnects-after-connection-close.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auto-reply.web-auto-reply.requires-mention-group-chats-injects-history-replying.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auto-reply.web-auto-reply.sends-tool-summaries-immediately-responseprefix.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auto-reply.web-auto-reply.supports-always-group-activation-silent-token-preserves.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
auto-reply.web-auto-reply.uses-per-agent-mention-patterns-group-gating.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
inbound.media.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
inbound.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
inbound.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
login-qr.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
login-qr.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
login.coverage.test.ts test: stabilize slow and flaky tests 2026-01-16 06:24:58 +00:00
login.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
login.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
logout.test.ts fix: stabilize tests and logging 2026-01-18 18:43:31 +00:00
media.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
media.ts fix: improve web image optimization 2026-01-24 01:18:58 +00:00
monitor-inbox.allows-messages-from-senders-allowfrom-list.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
monitor-inbox.blocks-messages-from-unauthorized-senders-not-allowfrom.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
monitor-inbox.captures-media-path-image-messages.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
monitor-inbox.streams-inbound-messages.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
outbound.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
outbound.ts fix: add per-channel markdown table conversion (#1495) (thanks @odysseus0) 2026-01-23 18:39:25 +00:00
qr-image.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
qr-image.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
reconnect.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reconnect.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
session.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
session.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
test-helpers.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
vcard.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00