-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid creating more than one refund payout #5649
Conversation
Double clicking the close ticketbutton creates two payout transactions. This fix makes sure only one payout transaction is created for the dispute. Restarting the client allows for creating another refund transaction for the dispute if needed.
@jmacxx could you review this one? Would be good to build a special release for refund agent. |
@@ -673,6 +673,13 @@ private void addButtons(Contract contract) { | |||
} | |||
|
|||
private void showPayoutTxConfirmation(Contract contract, DisputeResult disputeResult, ResultHandler resultHandler) { | |||
if (dispute.isPayoutDone()) { | |||
new Popup().headLine(Res.get("disputeSummaryWindow.close.alreadyPaid.headline")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The payoutDone
guard works fine, and it issues the log warning about avoiding double payouts. However I cannot get this warning popup to show - so it seems redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You get this warning if you try to do a payout on the same user twice without closing the counterparty ticket first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It solves the issue of being able to make multiple payouts by double clicks on the Close Ticket
button, but the new warning popup seems redundant as it is never shown. [edit] all good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK (sqrrm explained how to get the warning popup to show).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
Many thanks for the fix, during the reimbursements I did today I got the alert message about 2 payouts being generated and the need to restart the client. |
@refund-agent2 good to know it's all working as expected now. It's strange this hasn't happened before as it was an old bug, not something introduced recently. |
Double clicking the close ticketbutton creates two payout transactions.
This fix makes sure only one payout transaction is created for the
dispute.
Restarting the client allows for creating another refund transaction
for the dispute if needed.
Refund agent reported a case of a refund being done twice. This PR makes sure that two transactions are not created for the same refund during one session. It's still possible to restart the client to make another refund for an already closed ticket if needed.
I managed to reproduce at least one case of double refund transactions by double clicking the close ticket button, there might be other ways to trigger the refund payout twice, but with this fix it will only create one refund transaction no matter which way the payout was triggered.