fix(machine): persist transactions stuck in waitingForCashTaken

The IPC HAL path (production) never set halServices.value, so the
auto-advance from waitingForCashTaken → complete never fired. The
machine hung on "Cash Ready!" indefinitely — no transaction persisted.

Three fixes:
- Auto-advance now checks `isElectron` (covers IPC path)
- waitingForCashTaken has a 30s after-timeout as safety net
- Fix unscoped lightningPub refs in LNURL session helpers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Patrick Mulligan 2026-03-07 21:26:58 -05:00
commit d64f6cd9ab
3 changed files with 15 additions and 5 deletions

View file

@ -703,6 +703,10 @@ export function createATMMachine(
},
},
waitingForCashTaken: {
// Auto-advance after 30s — bills are already out, assume taken.
after: {
30000: 'complete',
},
on: {
CASH_DISPENSED: 'complete',
TIMEOUT: 'complete', // Assume taken