The 2026-04-30 lazy-heal fix in chat_files.go (PR #2366) ATTEMPTS to mint platform_inbound_secret on miss so legacy workspaces self-heal without requiring destructive reprovision. The pre-existing TestChatUpload_NoInboundSecret + TestChatDownload_NoInboundSecret tests asserted the 503 response shape but did NOT pin that the mint UPDATE actually fires — they happened to exercise the mint-failure branch (sqlmock unmatched UPDATE = error = "Failed to mint" code path returns 503 with "RFC #2312" detail, which still passed the original assertions). This means a regression that: - skipped the lazy-heal mint entirely - inverted the success/failure response branches - moved the mint to a different code path would not fail those tests. Fix: - TestChatUpload_NoInboundSecret_LazyHeal: mock the UPDATE successfully; assert sqlmock.ExpectationsWereMet (mint MUST run) + body contains "retry" + "30" (success branch). - TestChatUpload_NoInboundSecret_LazyHealFailure: mock the UPDATE to fail; assert body contains "Reprovision" (failure branch). - Same pair for the Download handler — independent code path means independent test. Pins both branches of both handlers (4 tests) so future drift trips the gate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| cmd/server | ||
| internal | ||
| migrations | ||
| pkg/provisionhook | ||
| .ci-force | ||
| .gitignore | ||
| .golangci.yaml | ||
| Dockerfile | ||
| Dockerfile.tenant | ||
| entrypoint-tenant.sh | ||
| go.mod | ||
| go.sum | ||