feat(machine): connectivity auto-recovery + on-screen Retry #82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/connection-recovery"
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?
Problem
A connectivity-type init failure (e.g. "No connected relays" when the box boots before the network is up) lands on the "ATM Unavailable" screen and stays there forever. Providing internet afterward does nothing:
App.vueonMounted try/catch → setsinitError, never retries).initErroronly self-clears forawaiting-fees; connectivity errors are terminal.Restart=alwayscan't help (the process doesn't exit).Fix — layered, cheapest-first recovery (see ADR-002 amendment in this PR)
onlineevent (recovers immediately when the network returns) plus a 45s backoff safety net (covers online-but-relay-unreachable). Recovery = a renderer reload → re-runs init from a clean JS context (no leaked actors/subscriptions), preserving HAL in the main process and pairing//var/libstate.Scoped to connectivity errors only; does not hijack
unpaired(pairing wizard),awaiting-fees(self-clears on the operator fee event), ormaintenance(operator-set).Changes
main.ts: newapp:recoverIPC →reloadRenderer()(resetssecretsConsumed);hal:initmade idempotent (reuse existing instance) so the recovery reload and the pre-existing watchdog crash-reload can't double-open the validator/dispenser serial ports — a latent-bug fix for the watchdog path too.preload.ts/electron.d.ts: exposerecoverApp().App.vue: recovery scheduler (online+ backoff) + kiosk Retry button.docs/adr/002-*: amendment — app recovery first-line, SSH/NetBird last-resort.flake.nix: exposenixosConfigurations.batm3-usbas a named config (extracted from the inlinedisk-image-batm3-usb) so a running stick's app can be updated in place vianix copy+switch-to-configuration— no reflash. Disk image builds from the same config.Verification
vue-tsctypecheck clean.switch-to-configuration test): service active,app:recoverpresent in the bundle, boots toidle,Fully initialized.🤖 Generated with Claude Code