IdleView offers Sell Bitcoin on machines with no dispenser #113
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
IdleView.vuerenders both touch zones unconditionally. There is no capability check anywhere in the file, so a cash-in-only machine advertises cash-out it cannot perform.Seen on the Raspberry Pi 4 reference build, which has a Pyramid Apex acceptor and no dispenser. Both buttons are offered; tapping Sell Bitcoin is a dead end.
Current behaviour
The two buttons are plain markup with click handlers and no guard:
A customer on such a machine can now get as far as the cash-out flow before anything stops them. With the dispenser made optional (
ea4c1f4) the failure is at least clean rather than a crash —dispenseCashreturnsNo dispenser fitted on this machine — cash-out unavailable— but that is a last-resort backstop at the hardware boundary, not a substitute for not offering the service.Worth noting this got worse, not better, with that commit. Before it, a machine with no dispenser failed HAL init outright and never reached the idle screen, so the dead button was unreachable. Now the machine runs correctly and the gap is visible to customers.
What the gate should key on
The renderer needs to know whether a dispenser is fitted. Today that fact only exists in the main process, where
initializeHaldecides it by testing the device path. Suggest surfacing it in the HAL status the renderer already consumes, rather than inferring it in the view from the preset — the preset says what the machine is meant to have, and the point of the optional-dispenser change was to tolerate reality differing from that.Cassette count is not a safe proxy. A machine can have a dispenser fitted with empty or unconfigured cassettes, which is a temporarily-unavailable state rather than a permanent capability gap, and the two should not look the same to a customer.
Scope
SupportView.vuealso documents "Tap Sell Bitcoin" in its help text and needs the same conditioning.Related: spirekeeper#48 covers the operator-side half of this, where the cassettes panel waits forever for a state event that a dispenser-less machine never publishes.