Open placer14 opened 5 years ago
The fix that I'm currently pursuing is an extraction of the normal behavior when a buyer CANCELs their own order, and using the same behavior in response to the CANCEL on the buyer side as well as an ERROR from the vendor side. Should be ready tomorrow.
Edit, more context: The ERROR state is, in fact, being returned to the buyer. But the node is waiting for the user to hit a button to initiate the refund. It's a curious extra step that neither @cpacia nor @jjeffryes have any ideas why this might be needed. So the fix looks like automatically attempting a refund if one is needed when an order enters ERROR state (as if the user had automatically pressed the cancel button in the UI).
We've uncovered an interesting race condition in the order handling. The scenario works as follows:
In this outcome, the buyer's funds appear to remain stuck in the order awaiting the vendor node to produce either Reject or Accept/Refund messages for the buyer to get their funds back.
Unclear whether the ERROR state is being returned to the buyer node or not. This might be enough for the Buyer to initiate a refund.
Manual intervention is required on the vendor side to remove the ERROR state so the vendor can reject the order as usual.
Proposed fix would allow the ERROR state to be sent to the buyer so the funds can be automatically retrieved. Need to investigate the feasibility of this fix.