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) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-19 01:28:26 -07:00
parent 468c5eb55f
commit fb7fe3d280
+2 -2
View File
@@ -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<string, number>();
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);
}