Surface fetch errors and add in-flight guards in Admin and Reports tabs #42

Open
opened 2026-07-17 03:08:46 +00:00 by claude-bot · 0 comments
Contributor

AdminTab.load() (AdminTab.jsx:25-49) only handles res.ok; a 403/500 leaves the panel at defaults with no message, indistinguishable from "no data" — the worst behavior for the tab whose job is diagnostics. Mutations (AdminTab.jsx:82-153: create home, grant/revoke membership, queue job, save settings) have no pending state, so double-clicks double-submit (two homes, duplicate membership calls). ReportsTab.jsx:19-32 silently skips failed snapshot/share-link fetches the same way.

Fix: track per-section error state and render an inline failure notice; add a submitting flag per action that disables its button while in flight. Reuse one small helper across both tabs. (AdminTab's login link at AdminTab.jsx:165 also hardcodes /auth/login where App.jsx:858 uses auth.loginUrl — align while here.)

Acceptance criteria

  • Failed admin fetches render visible errors per panel
  • All Admin mutations disabled while in flight
  • Reports snapshot/share failures surface a message

(Audit finding F-22, 2026-07-16 — Severity: Medium, Confidence: High)

`AdminTab.load()` (`AdminTab.jsx:25-49`) only handles `res.ok`; a 403/500 leaves the panel at defaults with no message, indistinguishable from "no data" — the worst behavior for the tab whose job is diagnostics. Mutations (`AdminTab.jsx:82-153`: create home, grant/revoke membership, queue job, save settings) have no pending state, so double-clicks double-submit (two homes, duplicate membership calls). `ReportsTab.jsx:19-32` silently skips failed snapshot/share-link fetches the same way. Fix: track per-section error state and render an inline failure notice; add a `submitting` flag per action that disables its button while in flight. Reuse one small helper across both tabs. (AdminTab's login link at `AdminTab.jsx:165` also hardcodes `/auth/login` where `App.jsx:858` uses `auth.loginUrl` — align while here.) **Acceptance criteria** - [ ] Failed admin fetches render visible errors per panel - [ ] All Admin mutations disabled while in flight - [ ] Reports snapshot/share failures surface a message *(Audit finding F-22, 2026-07-16 — Severity: Medium, Confidence: High)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/BatteryStorageCalculator#42
No description provided.