F012 — Bet Cancellation
Business Rule
At any point during a betting window (HOLE, FLOP, TURN), the player may cancel pending bets. Cancellation:- Removes pending bets from the display
- Restores the game state to whatever has been committed to the server
- JS / TS: Bet is reflected immediately in UI; TS deducts credits immediately, JS deducts in batch at
CC_DEDUCT_BETS - UMA: Bets are NOT committed to the API until the Deal button (spin) is pressed; cancel before Deal results in zero committed bets for the current stage
JavaScript Reference
Source:hedgeem-v4/odobo/src/js/buttons.js
CancelButtonPressed()callsClearRoundBets()which zeroshandBetValue[hand][GetDealStatus()]for all hands at the current deal stage.- Credits have not yet been deducted (deduction happens at
CC_DEDUCT_BETS), so cancel is a pure UI reset. - Cancel scope: current stage only, all hands
TypeScript Implementation
Source:standalone_reference_client/src/engine/GameEngine.ts
- Per-hand cancel button calls
cancelBets(handIndex)which removes bets for that hand from all stages and refunds credits immediately. - Cancel scope: all stages, per-hand (intentional difference from JS — see F011 design differences)
UMA Implementation
Source:gameClient/builds/hedgeem/platform.js
Cancel is triggered when game.min.js sends a connect:GameRequest with any non-spin action (typically action: 'cancel'). Platform.js responds by:
- Fetching
/api/tables/{tableId}/state(the current committed server state) - Rebuilding
buildGameStatus(currentHoleState, state)from the API response - Re-publishing
Api:action:dataReceivedwith the refreshed state - Setting
window._cancelRefreshDone = true
window._platformApi.triggerCancel() fires the cancel packet directly, bypassing the need to click the GDK cancel button.
Acceptance Criteria
UMA-testable ACs (via state bridge)
Version Parity
Test Coverage
Playwright spec:tests/features/F012-bet-cancellation.spec.ts — AC1–AC5 (UMA).
Run with:
Related Features
- F011 — Bet Placement (bets that cancel would remove)
- F010 — Chip Denominations (the chip value that was pending)
- F016 — Credits Wallet (TS only: cancel refunds credits immediately)