Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(plugins): give the real reason media replies are refused
Yudhi Armyndharis40a3db31d503
diff --git a/src/core/plugins/conversation-send-facade.spec.ts b/src/core/plugins/conversation-send-facade.spec.tsindex 1dd510b61..580040422 100644--- a/src/core/plugins/conversation-send-facade.spec.ts+++ b/src/core/plugins/conversation-send-facade.spec.ts@@ -168,7 +168,7 @@ describe('conversation.send facade', () => {});});- it('rejects replyTo on a media envelope — media-reply is unsupported by the engine', async () => {+ it('rejects replyTo on a media envelope: the plugin media port carries no quote', async () => {const sendMedia = jest.fn();const facade = buildConversationSendFacade({manifest: manifest(['conversation:send']) as never,@@ -263,7 +263,7 @@ describe('conversation.send facade', () => {expect(sendLocation).not.toHaveBeenCalled();});- it('rejects replyTo on a location envelope — the engine location path cannot quote', async () => {+ it('rejects replyTo on a location envelope: the plugin location port carries no quote', async () => {const sendLocation = jest.fn();const facade = buildConversationSendFacade({manifest: manifest(['conversation:send']) as never,diff --git a/src/core/plugins/conversation-send-facade.ts b/src/core/plugins/conversation-send-facade.tsindex b8223488e..bc2fe0211 100644--- a/src/core/plugins/conversation-send-facade.ts+++ b/src/core/plugins/conversation-send-facade.ts@@ -62,8 +62,8 @@ export function buildConversationSendFacade(deps: ConversationSendDeps) {// A location envelope is delivered as a native location pin. Without valid coordinates there// is NOTHING to send — reject loudly instead of degrading to an empty text message.if (env.type === 'location') {- // The engine location path cannot quote a message, so a location reply is not expressible.- // Reject rather than silently drop the quote (same rule as media).+ // The plugin location port (ConversationSendDeps, PluginMessagePort) carries no quotedMessageId,+ // so a location reply would lose its quote. Reject rather than silently drop it (same rule as media).if (env.replyTo) {throw new PluginCapabilityError('conversation.send: replyTo is not supported for location messages');}@@ -83,8 +83,8 @@ export function buildConversationSendFacade(deps: ConversationSendDeps) {// nothing to send as media, so it falls through to the text/reply path — a plugin that puts the// URL in `text` as a fallback still delivers a (text) message rather than erroring.if (isMediaType(env.type) && env.mediaUrl) {- // The engine media path takes only (chatId, media) — it cannot quote a message, so a media- // reply is not expressible. Reject rather than silently drop the quote.+ // The plugin media port (ConversationSendDeps, PluginMessagePort) carries no quotedMessageId, so+ // a media reply would lose its quote. Reject rather than silently drop it.if (env.replyTo) {throw new PluginCapabilityError('conversation.send: replyTo is not supported for media messages');}