Allow dispute to be closed if trade has paid out #6015
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6008
If a dispute is closed by the mediator but the user's side does not receive that message, user is left with an open mediation ticket that they cannot close. This change allows the user to close it if the trade no longer has funds locked in. Possible scenarios are the mediation paid out or the funds went to arbitration.
During testing I encountered a separate existing bug where a self-closed dispute could automatically reopen. Made a fix to this so that the auto reopening logic additionally checks for an unread message count. The scenario being that the when the mediator reopens a ticket, the user is notified by a system generated chat message.