The FSM action matrix in order_state.dart shows incorrect buttons during cooperative cancellation because it doesn't distinguish whether the cancellation was initiated from active or fiat-sent status.
When a cooperative cancel is pending and the order was in active status:
- The buyer loses the
fiat-sent button and cannot mark fiat as sent to complete the trade before the cancellation is finalized
- The seller sees a
release button that does nothing when pressed, because there is no hold invoice to release, the buyer never sent fiat
Root cause
The FSM has no memory of the previous status. When transitioning to cooperativelyCanceled, it shows the same buttons regardless of whether the order came from active or fiat-sent.
Location: lib/features/order/models/order_state.dart — Seller role lines 444-456, Buyer role lines 569-578 (Status.cooperativelyCanceled)
Expected behavior
| Role |
Previous status |
Cooperative cancel buttons |
| Buyer |
active |
fiatSent, cancel, dispute, sendDm |
| Buyer |
fiat-sent |
cancel, dispute, sendDm |
| Seller |
active |
cancel, dispute, sendDm (no release) |
| Seller |
fiat-sent |
release, cancel, dispute, sendDm |
The FSM action matrix in
order_state.dartshows incorrect buttons during cooperative cancellation because it doesn't distinguish whether the cancellation was initiated fromactiveorfiat-sentstatus.When a cooperative cancel is pending and the order was in
activestatus:fiat-sentbutton and cannot mark fiat as sent to complete the trade before the cancellation is finalizedreleasebutton that does nothing when pressed, because there is no hold invoice to release, the buyer never sent fiatRoot cause
The FSM has no memory of the previous status. When transitioning to
cooperativelyCanceled, it shows the same buttons regardless of whether the order came fromactiveorfiat-sent.Location:
lib/features/order/models/order_state.dart— Seller role lines 444-456, Buyer role lines 569-578 (Status.cooperativelyCanceled)Expected behavior
activefiat-sentactivefiat-sent