← Back to PRs

#9606: fix: pass fileName to WhatsApp document messages

by AytuncYildizli open 2026-02-05 12:54 View on GitHub →
channel: whatsapp-web agents size: XS
Fixes #5781 - WhatsApp document filename always shows 'file' instead of actual filename. Changes: - src/web/active-listener.ts: Add fileName to ActiveWebSendOptions type - src/web/outbound.ts: Extract and pass mediaFileName through sendOptions - src/web/inbound/send-api.ts: Use sendOptions?.fileName with fallback to 'file' This properly wires the filename from loadWebMedia through the send path. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR wires a media filename through the WhatsApp Web outbound send path so that document messages use the original filename instead of always sending `"file"`. Concretely: - `src/web/active-listener.ts` extends `ActiveWebSendOptions` with an optional `fileName`. - `src/web/outbound.ts` captures `media.fileName` from `loadWebMedia()` and includes it in `sendOptions` when present. - `src/web/inbound/send-api.ts` uses `sendOptions?.fileName || "file"` when building the Baileys document payload. This fits into the existing architecture where `src/web/outbound.ts` prepares media metadata and forwards it through `ActiveWebListener.sendMessage()` into the WhatsApp Web send API adapter (`src/web/inbound/send-api.ts`). <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk. - Changes are small, type-only extension plus straightforward propagation of an existing `loadWebMedia().fileName` value to the WhatsApp document payload, with a conservative fallback to the previous constant value. - No files require special attention <!-- greptile_other_comments_section --> <sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs