Silent data loss: user messages were never persisted due to a nonexistent column
Every user message in nwhitehouse's fork was silently dropped on write. The insert referenced a `workflow` column that doesn't exist in the schema; Supabase returned PGRST204 and the app never checked the result.
The bug is in both POST /chat and POST /projects/:id/chat. Both builds the insert payload with a workflow field that isn't in the chat_messages schema. Supabase's PostgREST returns PGRST204 - "no content matched" - when an unknown column is included, and silently rejects the entire row. Neither route checked error on the response.
Live sessions appeared correct because ChatView keeps message history in memory. The failure only surfaced on chat reload: the DB had zero user rows, so the reconstructed history showed only assistant messages.
The fix drops the workflow field from both inserts and adds console.error on insert failures for both user and assistant rows. No migration needed; the column just wasn't there.
This is worth checking in any fork that copied the insert shape from upstream. Grep for .insert( against chat_messages and compare the column list to your live schema. The defensive logging pattern - capturing { error } from Supabase and logging it rather than ignoring the return value - is worth applying broadly to any DB write that matters.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?