foodsnap/supabase/functions/meta-whatsapp-webhook
marciobever eb2ceab354 fix(webhook): move Coach state update outside setTimeout + re-read state before Food Scan + simplify menu
Root cause: the COACH_FRONT state was being saved inside setTimeout,
creating a race condition where the next message arrives before state
is persisted. Now state is saved synchronously before returning.

Also added a safety guard that re-reads state from DB right before
entering Food Scan flow, making it impossible for coach photos to
be incorrectly processed as food.

Menu simplified to two clear options: Analisar Prato / Coach Corporal.
2026-04-22 16:33:20 -03:00
..
.npmrc feat: premium UI redesign, WhatsApp list menus, freemium coach flow, Stripe direct checkout 2026-04-14 11:36:48 -03:00
deno.json feat: premium UI redesign, WhatsApp list menus, freemium coach flow, Stripe direct checkout 2026-04-14 11:36:48 -03:00
index.ts fix(webhook): move Coach state update outside setTimeout + re-read state before Food Scan + simplify menu 2026-04-22 16:33:20 -03:00
pdf-template.ts feat: premium UI redesign, WhatsApp list menus, freemium coach flow, Stripe direct checkout 2026-04-14 11:36:48 -03:00
prompt.ts feat: premium UI redesign, WhatsApp list menus, freemium coach flow, Stripe direct checkout 2026-04-14 11:36:48 -03:00