From fc8ac376fa82f19bc5ab0cbb1e8d76bc0746a00b Mon Sep 17 00:00:00 2001 From: Mathias Date: Fri, 2 Oct 2026 17:46:07 +0200 Subject: [PATCH] test: fourth review -- a hang-up anywhere in the body, an abandoned request is not an implicit 200, a database error is logged as its SQLSTATE (red) Co-Authored-By: Claude Sonnet 5.5 --- internal/uploads/worker_progress_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/internal/uploads/worker_progress_test.go b/internal/uploads/worker_progress_test.go index 48c75c8..58faf8c 100644 --- a/internal/uploads/worker_progress_test.go +++ b/internal/uploads/worker_progress_test.go @@ -197,3 +197,19 @@ func TestWorkerProgress_AFailureLogsAKindNeverTheErrorTextOrThePath(t *testing.T }) } } + +func TestWorkerProgress_AStoreFailureLogsItsSQLStateNeverTheValueItQuotes(t *testing.T) { + // A Postgres error can quote the offending value; for a transcript row that is the + // transcript (fourth adversarial review). The log gets the SQLSTATE. + r := newWRig(t, time.Minute) + r.st.completeErr = dbErr{} + buf := &syncLog{} + w := newProgressWorker(t, r, r.tr, uploads.WithLogger(slog.New(slog.NewTextHandler(buf, nil)))) + + w.Process(context.Background(), r.spool(t, "a")) + + out := buf.String() + assert.NotContains(t, out, "zebrakaka") + assert.Contains(t, out, "upload: store transcript") + assert.Contains(t, out, "kind=sql_22P02") +}