feat: DWH connectivity probe at startup — modal alert within 5s if unreachable

Backend: GET /health/dwh (unauthenticated) calls tht db ping with a 5s
timeout. Frontend: checkDwhHealth() races a 5s timer against the fetch;
on failure a non-dismissable Dialog with Retry appears immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-20 13:59:11 +02:00
co-authored by Claude Opus 4.6
parent 83942c0b5c
commit 3b52c8c08c
7 changed files with 60 additions and 7 deletions
@@ -100,7 +100,7 @@ test("a DWH-unreachable precheck shows a specific alert and preserves the questi
http.post("http://localhost:8787/sessions", () =>
HttpResponse.json(
{
error: "Cannot start a session: the data warehouse is unreachable. Check the VPN connection and try again.",
error: "Cannot start a session: the database is unreachable. Check the VPN connection and try again.",
code: "dwh_unreachable",
},
{ status: 503 },
@@ -113,7 +113,7 @@ test("a DWH-unreachable precheck shows a specific alert and preserves the questi
await userEvent.click(screen.getByRole("button", { name: /send/i }));
// Specific alert, not the generic "failed to create session" hint.
expect(await screen.findByText(/data warehouse is unreachable/i)).toBeInTheDocument();
expect(await screen.findByText(/database is unreachable/i)).toBeInTheDocument();
expect(screen.queryByText(/failed to create session/i)).not.toBeInTheDocument();
// No session was created: landing view stays and the question is kept for retry.
expect(screen.getByText(/type your question/i)).toBeInTheDocument();