From f85a4a3300a20f5e34ad11e4e28cdc0725eae1a3 Mon Sep 17 00:00:00 2001 From: marciobever Date: Wed, 22 Apr 2026 15:45:26 -0300 Subject: [PATCH] =?UTF-8?q?fix(webhook):=20replace=20return=20Response=20w?= =?UTF-8?q?ith=20return=20in=20processMetaMessage=20=E2=80=94=20root=20cau?= =?UTF-8?q?se=20of=20coach=20photos=20being=20treated=20as=20food=20scans?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supabase/functions/meta-whatsapp-webhook/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/supabase/functions/meta-whatsapp-webhook/index.ts b/supabase/functions/meta-whatsapp-webhook/index.ts index 657acae..c4e49bf 100644 --- a/supabase/functions/meta-whatsapp-webhook/index.ts +++ b/supabase/functions/meta-whatsapp-webhook/index.ts @@ -888,7 +888,7 @@ RETORNE estritamente 3 bullet points recomendando o que o paciente pode adiciona "πŸ“Έ *ENVIE SUA FOTO*\n\nTire uma selfie no espelho ou foto de frente do seu corpo.\n\nβœ… Boa iluminaΓ§Γ£o\nβœ… Sem camisa (homens) ou de Top/Regata (mulheres)\nβœ… Mostrando do pescoΓ§o atΓ© a cintura/joelhos" ); }, 0); - return new Response("Coach Started", { status: 200 }); + return; } // COACH_FRONT @@ -897,7 +897,7 @@ RETORNE estritamente 3 bullet points recomendando o que o paciente pode adiciona setTimeout(async () => { await sendWhatsAppMessage(remoteJid, "⚠️ Por favor, envie a foto de *FRENTE* para continuarmos."); }, 0); - return new Response("Waiting for image", { status: 200 }); + return; } // Offload long-running task to background @@ -928,7 +928,7 @@ RETORNE estritamente 3 bullet points recomendando o que o paciente pode adiciona ] ); }, 0); - return new Response("Coach Photo image received", { status: 200 }); + return; } // COACH_GOAL @@ -1104,7 +1104,7 @@ RETORNE estritamente 3 bullet points recomendando o que o paciente pode adiciona .eq("phone_number", senderNumber); } }, 0); - return new Response("Coach Workflow Completed", { status: 200 }); + return; } // ── 6. Food Scan Flow (IDLE) ──────────────────────────────── @@ -1414,7 +1414,7 @@ RETORNE estritamente 3 bullet points recomendando o que o paciente pode adiciona } }, 0); - return new Response("Food Scan Started", { status: 200 }); + return; } } catch (criticalErr) { // Capture da funΓ§Γ£o async flutuante