feat(client): probe /api/health on server-setup save #236
Labels
No labels
area:auth
area:ci
area:db
area:infra
area:native
area:pwa
area:service
epic
feature
foundation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol#236
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The
/server-setupscreen on native (Android, Tauri shell) validates that the entered server URL is a well-formedhttp(s)://<host>string before saving (lib/serverUrlValidate.ts), but it doesn't actually probe whether the URL points at a running Carol instance. The reachability test happens implicitly on the next login attempt — by which point the user has filed away a wrong URL and the error surfaces as a confusing "Network request failed" or "Invalid credentials" rather than "this isn't Carol."The original RN scaffolding ticket (#29) called for hitting
/api/healthbefore saving the URL, with a clear error on failure. That criterion didn't land in the #207 implementation and was acknowledged by the implementing agent in the PR body. Closing #29 leaves this gap orphaned, so it lives here.Source
#29 acceptance criterion 2: "An invalid or unreachable URL produces a clear error and isn't saved."
Scope
In
apps/client/app/server-setup.tsx(or a sibling validator):http(s)://check passes, before saving to SecureStore, issue aGET <url>/api/healthwith a short timeout (5s default; configurable in code if needed for slow LANs).{ status: "ok" }(or whatever/api/healthcurrently returns — read it, don't guess) as success."Can't reach that URL. Check the address and that the server is running.""That URL replied, but doesn't look like Carol. Check you've copied the address from the right place."react-i18next. Add new keys underserverSetup.*(or whichever namespace the screen already uses).useTheme()./api/healthis in the public-routes allowlist (apps/api/lib/auth/public-routes.ts), so the probe doesn't need auth — perfect for first-launch validation.Acceptance criteria
/loginas today.Out of scope
Composes with
/api/healthsurface decisions (this ticket relies on the endpoint's response shape).Part of
Standalone — no parent epic.