feat(web): app-wide service-unavailable banner when bunyip-api is down (BUNYIP-243) #278
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/BUNYIP-243-server-down-banner"
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?
What
When bunyip-api is unreachable the BFF (bunyip-web) degraded silently and indistinguishably from real conditions:
dashboard.rscollapsed to an empty list via.unwrap_or_default(),auth.rstreated any non-401 error as signed-out (phantom logout), and other handlers showed a generic "unexpected error". Reflect it instead as one clear app-wide "Service unavailable" state. Closes BUNYIP-243 (the bunyip-web counterpart of MAPPS-333).Changes
bunyip-web/src/server_status.rs: a process-globalAtomicBool"api reachable" flag (default reachable), a classifier, an SSR banner partial, and a recovery poll.Api::send(api/mod.rs): a transport failure or5xxmarks down; any real response (including4xx) clears it, so auth/validation errors keep their normal per-handler handling. Also classifiespost_form()and theget_stream()download proxy.document()shell (views/layout.rs), so it shows on every page including/login: a phantom-logout bounce now lands on a login page that clearly says the service is unavailable, instead of looking like a normal logout. Renders nothing while healthy.main.rs): while down, hit bunyip-apiGET /healthevery 10s and clear on first success. No network while healthy; banner auto-dismisses on recovery.Acceptance criteria coverage
5xx;4xxdoes not./healthpoll clears the state on first success; no polling while healthy; auto-dismiss on recovery./logintoo, so a down API is communicated rather than reading as a logout. (A deeper change to skip the/loginredirect entirely during an outage was left out to avoid touching the auth/guard redirect flow; the banner-on-login covers the user-visible AC.)EventSourcedrop client-side (and not surfacing its opaque failure as a CORS error in the console) is not included here and can be a follow-up; the EventSource already auto-reconnects.Verification
just check-containergreen in therust-builder-glibc:v1.0.1-rust1.94-trixieCI image:cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace --lib(270 tests pass). Manual AC (stop bunyip-api -> banner within one poll, no phantom logout / empty dashboard; restart -> auto-clear) needs the live stack and was not exercised here.