From fb7fe3d280261ebb14778f564c774769297c0ab4 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 19 Mar 2026 01:28:26 -0700 Subject: [PATCH] fix: select existing columns from ship_logs in weekly digest P2 from Codex review: weekly digest selected nonexistent 'email' column from ship_logs, causing a silent Supabase error that dropped all ship activity from the digest. Now selects user_id, version, branch, pr_url which all exist in the schema. Co-Authored-By: Claude Opus 4.6 (1M context) --- supabase/functions/weekly-digest/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supabase/functions/weekly-digest/index.ts b/supabase/functions/weekly-digest/index.ts index 29702bf1..56ed581d 100644 --- a/supabase/functions/weekly-digest/index.ts +++ b/supabase/functions/weekly-digest/index.ts @@ -134,7 +134,7 @@ Deno.serve(async (_req: Request) => { .eq('team_id', teamId) .gte('timestamp', weekAgo), supabase.from('ship_logs') - .select('user_id, email') + .select('user_id, version, branch, pr_url') .eq('team_id', teamId) .gte('created_at', weekAgo), supabase.from('session_transcripts') @@ -178,7 +178,7 @@ Deno.serve(async (_req: Request) => { // Ships by person const shipsByPerson = new Map(); for (const log of shipLogs) { - const key = String(log.email || log.user_id || 'unknown'); + const key = String(log.user_id || 'unknown'); shipsByPerson.set(key, (shipsByPerson.get(key) || 0) + 1); }