dashboard: pending-device approve/decline are fire-and-forget — a failed verb looks like a broken button #299

Closed
opened 2026-08-05 23:10:59 +00:00 by ben · 1 comment
Owner

dashboard/src/components/device-add/PendingDevicesSurface.vue:76,80 — void props.source.approve(row.id) / void props.source.decline(row.id, …) on a state-changing verb. On rejection nothing renders, the row stays pending (the watcher re-reads unchanged state), and the operator concludes the button is broken and clicks again.

Also dashboard/src/components/device-add/DeviceAddSurface.vue:75-76 — onMint unguarded; a failed mintCode leaves Add Device with no code and no explanation.

Acceptance

  • Approve/decline/mint failures render an error (row-level or surface-level) with the verb retryable; no void-discarded state-changing calls.
  • Vitest per verb.

Filed from the 2026-08-05 fail-loud audit (three-agent pre-production sweep; findings verified against code).

`dashboard/src/components/device-add/PendingDevicesSurface.vue:76,80` — `void props.source.approve(row.id)` / `void props.source.decline(row.id, …)` on a state-changing verb. On rejection nothing renders, the row stays `pending` (the watcher re-reads unchanged state), and the operator concludes the button is broken and clicks again. Also `dashboard/src/components/device-add/DeviceAddSurface.vue:75-76` — `onMint` unguarded; a failed mintCode leaves Add Device with no code and no explanation. **Acceptance** - Approve/decline/mint failures render an error (row-level or surface-level) with the verb retryable; no `void`-discarded state-changing calls. - Vitest per verb. --- _Filed from the 2026-08-05 fail-loud audit (three-agent pre-production sweep; findings verified against code)._
Author
Owner

Fixed in b2e30f2 (on origin/main).

PendingDevicesSurface.vue drove the pending card's approve/decline as void props.source.<verb>(…) and DeviceAddSurface.vue's onMint (plus onRevoke) awaited the seam unguarded. Both surfaces now route every verb through useAsyncGuard: a rejection renders OcErrorState (data-status="pending-device-error" / data-status="device-add-error") whose Try again re-runs the verb that failed — deliberately not a re-read, since re-reading unchanged pending state would still look like a dead button. A failed mint opens no code screen and leaves Add device in place beside the error; a failed revoke keeps the code screen with a retry.

Test-first at the seam: dashboard/tests/unit/deviceAddGuard.test.ts — one case per verb (approve/decline/mint/revoke): each rejects ⇒ honest error + retry, no false advance, then a retry re-runs the verb and lands. Full dashboard suite 951 green, vue-tsc clean. STATUS.md header + milestone log updated in the same commit.

Acceptance: approve/decline/mint failures render a retryable error with no void-discarded state-changing calls ✓; Vitest per verb ✓.

Fixed in b2e30f2 (on origin/main). `PendingDevicesSurface.vue` drove the pending card's `approve`/`decline` as `void props.source.<verb>(…)` and `DeviceAddSurface.vue`'s `onMint` (plus `onRevoke`) awaited the seam unguarded. Both surfaces now route every verb through `useAsyncGuard`: a rejection renders `OcErrorState` (`data-status="pending-device-error"` / `data-status="device-add-error"`) whose Try again re-runs the **verb** that failed — deliberately not a re-read, since re-reading unchanged pending state would still look like a dead button. A failed mint opens no code screen and leaves Add device in place beside the error; a failed revoke keeps the code screen with a retry. Test-first at the seam: `dashboard/tests/unit/deviceAddGuard.test.ts` — one case per verb (approve/decline/mint/revoke): each rejects ⇒ honest error + retry, no false advance, then a retry re-runs the verb and lands. Full dashboard suite 951 green, `vue-tsc` clean. STATUS.md header + milestone log updated in the same commit. Acceptance: approve/decline/mint failures render a retryable error with no `void`-discarded state-changing calls ✓; Vitest per verb ✓.
ben closed this issue 2026-08-06 00:49:36 +00:00
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
Matou/idss#299
No description provided.