Description
The interactive vending machine FSM has two related
bugs in assets/js/interactive_soda_machine.js
Bug 1 — Buttons re-enable during Wait states
Steps to reproduce:
Click "Drop 10¢"
Click "Drop 10¢" again (total = 20¢)
Machine enters W20 wait state
Buttons sometimes still appear
If user clicks "Drop 5¢" → gets only soda,
no change returned
If user clicks "Drop 10¢" → gets soda +
only 5¢ change instead of correct amount
Expected Behavior
Buttons should be completely disabled from the
moment a coin is inserted until the machine
returns to idle state M0
Root Cause in Code
The button enable condition only checks:
if (soda_machine_fsm.state <= 4)
This misses states W15 (5) and W20 (6) where
buttons should still be disabled
Bug 2 — No feedback during processing
When machine is in any Wait state (W5, W10,
W15, W20) the buttons disappear but no message
is shown to the user explaining what is happening
Expected Behavior
Show a clear message like "Processing coin..."
or "Please wait..." during all wait states
Files affected
assets/js/interactive_soda_machine.js
problem.video1.mp4
problem.video.2.mp4
Description
The interactive vending machine FSM has two related
bugs in assets/js/interactive_soda_machine.js
Bug 1 — Buttons re-enable during Wait states
Steps to reproduce:
no change returned
only 5¢ change instead of correct amount
Expected Behavior
Buttons should be completely disabled from the
moment a coin is inserted until the machine
returns to idle state M0
Root Cause in Code
The button enable condition only checks:
if (soda_machine_fsm.state <= 4)
This misses states W15 (5) and W20 (6) where
buttons should still be disabled
Bug 2 — No feedback during processing
When machine is in any Wait state (W5, W10,
W15, W20) the buttons disappear but no message
is shown to the user explaining what is happening
Expected Behavior
Show a clear message like "Processing coin..."
or "Please wait..." during all wait states
Files affected
assets/js/interactive_soda_machine.js
problem.video1.mp4
problem.video.2.mp4