Smarter dispense error handling and recovery #30

Closed
opened 2026-06-13 22:02:52 +00:00 by padreug · 0 comments
Owner

Migrated from aiolabs/lamassu-next#30 — opened by @padreug on 2026-02-23.\n\n## Status

The original dead-end issue is fixed (commit e51f462): dispenseError is now a 30s timed state with partial dispense info, txid QR, and countdown. dispenseCash always resolves with structured DispenseCashResult.

Remaining work

Smarter error handling beyond the basic timed error screen:

  • Operator notifications — send a Nostr DM or webhook when a dispense fails (operator needs to know cash was owed)
  • Persist partial dispense on error — persistTransaction currently only fires on complete state, not dispenseError; partial dispense data should be saved for reconciliation
  • Out-of-cash detection — if inventory hits zero, proactively disable cash-out rather than letting the user pay and then fail
  • Dispenser re-init after errors — brain.js re-initializes the dispenser after errors to clear jam states (see also #29)
  • Error categorization — distinguish "out of cash" vs "mechanical jam" vs "communication error" to show different messages and take different recovery actions
  • Partial dispense accounting — if 1 of 2 bills dispensed, calculate the fiat value actually given and show it to the user (currently shows per-bill counts but not the dollar total)
  • #29 — Dispenser re-initialization after errors
  • #27 — Smart cassette fallback on dispenser pickup errors
  • #34 — Backport error handling patterns from legacy lamassu-machine
> _Migrated from [aiolabs/lamassu-next#30](https://git.atitlan.io/aiolabs/lamassu-next/issues/30) — opened by @padreug on 2026-02-23._\n\n## Status The original dead-end issue is fixed (commit `e51f462`): `dispenseError` is now a 30s timed state with partial dispense info, txid QR, and countdown. `dispenseCash` always resolves with structured `DispenseCashResult`. ## Remaining work Smarter error handling beyond the basic timed error screen: - [ ] **Operator notifications** — send a Nostr DM or webhook when a dispense fails (operator needs to know cash was owed) - [ ] **Persist partial dispense on error** — `persistTransaction` currently only fires on `complete` state, not `dispenseError`; partial dispense data should be saved for reconciliation - [ ] **Out-of-cash detection** — if inventory hits zero, proactively disable cash-out rather than letting the user pay and then fail - [ ] **Dispenser re-init after errors** — brain.js re-initializes the dispenser after errors to clear jam states (see also #29) - [ ] **Error categorization** — distinguish "out of cash" vs "mechanical jam" vs "communication error" to show different messages and take different recovery actions - [ ] **Partial dispense accounting** — if 1 of 2 bills dispensed, calculate the fiat value actually given and show it to the user (currently shows per-bill counts but not the dollar total) ## Related - #29 — Dispenser re-initialization after errors - #27 — Smart cassette fallback on dispenser pickup errors - #34 — Backport error handling patterns from legacy lamassu-machine
Sign in to join this conversation.
No labels
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
aiolabs/bitspire#30
No description provided.