foodsnap/supabase/functions
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
..
coach-generator feat: premium UI redesign, WhatsApp list menus, freemium coach flow, Stripe direct checkout 2026-04-14 11:36:48 -03:00
meta-whatsapp-webhook fix(webhook): move Coach state update outside setTimeout + re-read state before Food Scan + simplify menu 2026-04-22 16:33:20 -03:00
stripe-checkout feat: premium UI redesign, WhatsApp list menus, freemium coach flow, Stripe direct checkout 2026-04-14 11:36:48 -03:00
stripe-portal feat: premium UI redesign, WhatsApp list menus, freemium coach flow, Stripe direct checkout 2026-04-14 11:36:48 -03:00
stripe-webhook feat: premium UI redesign, WhatsApp list menus, freemium coach flow, Stripe direct checkout 2026-04-14 11:36:48 -03:00
validate-access feat: premium UI redesign, WhatsApp list menus, freemium coach flow, Stripe direct checkout 2026-04-14 11:36:48 -03:00
whatsapp-webhook feat: premium UI redesign, WhatsApp list menus, freemium coach flow, Stripe direct checkout 2026-04-14 11:36:48 -03:00