fix(webui): sanitise dashboard chat error responses (#1908) #1909

Merged
sam merged 2 commits from fix/1908-webui-chat-errors into main 2026-11-12 13:23:30 +00:00
Owner

Chat handlers returned raw contract errors (SQL fragments, gRPC status details, host paths) to the browser. Every 5xx/transport failure in internal/webui/chat.go now answers with a plain sentence in the gateway's wording and logs the real cause via the injected logger's ErrorContext; the SSE error frame on stream-open failure gets the same treatment. Safe 400 validation messages and the 404 'session not found' are unchanged. New table-driven tests in internal/webui/chat_errors_test.go prove a contract fake whose error embeds a SQL fragment produces a sanitised body and SSE frame, and that the cause lands in the server log; they fail against the old handlers. Verified: go test -short ./internal/webui/... ok, task check exit 0 (fmt, proto:check, db:check, vet, golangci-lint 0 issues, build, go test ./..., pnpm test 102 pass, vue-tsc typecheck).

Chat handlers returned raw contract errors (SQL fragments, gRPC status details, host paths) to the browser. Every 5xx/transport failure in internal/webui/chat.go now answers with a plain sentence in the gateway's wording and logs the real cause via the injected logger's ErrorContext; the SSE error frame on stream-open failure gets the same treatment. Safe 400 validation messages and the 404 'session not found' are unchanged. New table-driven tests in internal/webui/chat_errors_test.go prove a contract fake whose error embeds a SQL fragment produces a sanitised body and SSE frame, and that the cause lands in the server log; they fail against the old handlers. Verified: go test -short ./internal/webui/... ok, task check exit 0 (fmt, proto:check, db:check, vet, golangci-lint 0 issues, build, go test ./..., pnpm test 102 pass, vue-tsc typecheck).
sam added 1 commit 2026-11-12 13:10:38 +00:00
fix(webui): sanitise dashboard chat error responses (#1908)
ci/woodpecker/pr/quality Pipeline was successful
Quality / check (pull_request) Successful in 7m28s
14da38b9b7
Chat handlers returned raw contract errors to the browser, which can
carry SQL fragments, gRPC status details or host paths. Each 5xx and
transport failure now answers with a plain sentence in the gateway's
wording and logs the real cause through the injected logger's
ErrorContext. The SSE error frame on stream-open failure gets the same
treatment. Safe 400 validation messages and the 404 'session not found'
are unchanged.
sam added 1 commit 2026-11-12 13:23:16 +00:00
Merge branch 'main' into fix/1908-webui-chat-errors
ci/woodpecker/pr/quality Pipeline was successful
Quality / check (pull_request) Successful in 4m40s
27e997e0d9
sam merged commit 779b036d95 into main 2026-11-12 13:23:30 +00:00
sam deleted branch fix/1908-webui-chat-errors 2026-11-12 13:23:30 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1909