Hotfix debugging workflow — reproduce, diagnose, fix, verify.
Structured workflow for quickly diagnosing and fixing bugs in production or development.
fix(scope): description commit format.stripe.* tablesmcp__supabase to view Edge Function logs for the stripe-sync functionstripe.* tables have latest data: Query stripe.subscriptions, stripe.customers via MCP SupabasesyncSingleEntity(): For missing records, trigger a single-entity sync to backfillmcp__stripe or Dashboard)DATABASE_URL, STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET are set on the Edge Function via MCP Supabaserequest.text() is used, NOT request.json(). The constructEvent function requires the raw string body.STRIPE_WEBHOOK_SECRET matches the endpoint's secret in Stripe Dashboard (different for test vs live, different for Stripe CLI vs dashboard).stripe listen --forward-to localhost:3000/api/webhooks/stripe and check CLI output.SELECT * FROM pg_policies WHERE tablename = 'table_name';set request.jwt.claims = '{"sub": "user-uuid"}';auth.uid() matches the column being checked (e.g., user_id, created_by).service_role key in server-side code to verify data exists, then fix the policy.middleware.ts running on the right routes? Check config.matcher.getUser() vs getSession(): getSession() doesn't validate the JWT — use getUser() for reliable auth checks./auth/callback route handler — is it exchanging the code for a session?mcp__stripe)stripe.subscriptions table: Query via mcp__supabase SQL for the user's stripe_customer_idmcp__stripe) with stripe.subscription table data (via mcp__supabase)syncSingleEntity() for the specific customer/subscriptionstatus = 'active' vs status IN ('active', 'trialing'))stripe.* tables? Test the RLS policy