<p>We got growing pending mailbox messages since 1.4.2. (about 2000 now, normal is about 500). With the trade protocol refactoring a cleanup for mailbox messages has been missed.</p>
<p>Steps to reproduce issue:<br>
Start a trade and let peer go offline. When Seller confirms receipt he sends a msg to buyer, as he is offline its a mailbox msg. Seller moves funds to his wallet and his trade is closed. Buyer goes online and closes his trade as well. He sends back a AckMessage that he received the trade message but as sellers trade is closed that ackMsg is not being processed (done in tradeProtocol class which is not initialized for closed trades).</p>
<p>Solution:<br>
We iterate closed and failed trades and look up if there are some pending mailbox messages and if we find any we remove them from the network.<br>
It can be that there are failure scenarios where mailbox messages did not got removed as well. This should fix those cases as well.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/bisq-network/bisq/pull/4746'>https://github.com/bisq-network/bisq/pull/4746</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Clean up mailbox messages for closed trades</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4746/files#diff-37c3b47b826f623fefe33260bc604f9fd907cc45d7a3c1d8d3f6f71de34f8c7f">core/src/main/java/bisq/core/app/DomainInitialisation.java</a>
    (10)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4746/files#diff-f24ccc2fb412040e1bf11ca2e4193caff23cfe990e775374c15fbc689fa040dd">core/src/main/java/bisq/core/trade/closed/CleanupMailboxMessages.java</a>
    (129)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4746/files#diff-d988326d46023de5708487182c130e5b90dae3e91deb15078381d3231e427996">core/src/main/java/bisq/core/trade/closed/ClosedTradableManager.java</a>
    (10)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4746/files#diff-72487d9cf0255fc80f6eba13356e3212033a31088cc341022ab7f5bf6147be18">core/src/main/java/bisq/core/trade/failed/FailedTradesManager.java</a>
    (8)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/4746.patch'>https://github.com/bisq-network/bisq/pull/4746.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/4746.diff'>https://github.com/bisq-network/bisq/pull/4746.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/4746">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNTOWZ5AELPMNMOMSIDSODCDBANCNFSM4TJQN6DA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNXVJXFJGURIKEYRPATSODCDBA5CNFSM4TJQN6DKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4K63D4TQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/4746",
"url": "https://github.com/bisq-network/bisq/pull/4746",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>