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") +}