Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2638,10 +2638,10 @@ export class BaileysStartupService extends ChannelStartupService {
}
}

const linkPreview = options?.linkPreview === false ? false : undefined;
const linkPreview = options?.linkPreview === true ? true : false;

let previewContext: any = undefined;
if (linkPreview !== false && (message as any)?.conversation) {
if (linkPreview === true && (message as any)?.conversation) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Chatbot URL replies still fail

When a chatbot integration sends a reply containing a URL, the chatbot adapters pass linkPreview: true for replies without an explicit preview request from the chatbot consumer, so sendMessageWithTyping still calls generateLinkPreview() and URL replies can remain undelivered.

Have chatbot integrations default to previews off and pass true only when their consumer explicitly opts in.

Prompt for AI agents
In `src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts` at line 2644:

**Chatbot URL replies still fail**

When a chatbot integration sends a reply containing a URL, the chatbot adapters pass `linkPreview: true` for replies without an explicit preview request from the chatbot consumer, so `sendMessageWithTyping` still calls `generateLinkPreview()` and URL replies can remain undelivered.

Have chatbot integrations default to previews off and pass `true` only when their consumer explicitly opts in.

previewContext = await this.generateLinkPreview((message as any).conversation);
}

Expand Down
Loading