feat: upload audio, get a private Swedish transcript, discuss it (#33, ADR-033) #39

Merged
mathias merged 299 commits from feat/33-audio-upload-transcript into main 2026-10-03 14:13:37 +00:00
Showing only changes of commit 5368d5f8c2 - Show all commits
+19
View File
@@ -3,6 +3,7 @@ package web_test
import (
"bytes"
"context"
"log/slog"
"mime/multipart"
"net/http"
"net/http/httptest"
@@ -336,3 +337,21 @@ func TestUploadPage_AlsoCarriesTheVideoNotice(t *testing.T) {
assert.Contains(t, body(t, do(t, app, get("/uploads/"+id))), "Only its audio was used")
}
func TestUploadPost_ARejectionIsLoggedWithItsReasonAndNeverTheFilenameOrTitle(t *testing.T) {
// Rejections are synchronous and leave no row, so without a log line an operator
// cannot tell "the user never retried" from "the page refused it". The reason is
// operational; the filename and title are the user's private content.
var buf bytes.Buffer
app, _ := newUploadApp(t, uploads.Probe{Duration: time.Minute, HasVideo: true}, 1<<20)
app.Log = slog.New(slog.NewTextHandler(&buf, nil))
rec := do(t, app, uploadReq(t, "Secret project notes", "client-acme-roadmap.mp4", []byte("x")))
require.Equal(t, http.StatusUnprocessableEntity, rec.Code)
logged := buf.String()
assert.Contains(t, logged, "upload rejected")
assert.Contains(t, logged, "reason=no_audio")
assert.NotContains(t, logged, "Secret project notes", "the title is private content")
assert.NotContains(t, logged, "client-acme-roadmap", "the filename is private content")
}