<p></p>
<p><b>@sqrrm</b> commented on this pull request.</p>
<p>Seems mostly good. I wonder about the size check to push out old messages though.</p><hr>
<p>In <a href="https://github.com/bisq-network/bisq/pull/5072#discussion_r557512467">p2p/src/main/java/bisq/network/p2p/mailbox/MailboxMessageService.java</a>:</p>
<pre style='color:#555'>> @@ -271,18 +271,19 @@ public void removeMailboxMsg(MailboxMessage mailboxMessage) {
// mailboxMessageList while getting called.
UserThread.execute(() -> {
String uid = mailboxMessage.getUid();
-
- // We called removeMailboxEntryFromNetwork at processMyMailboxItem,
- // but in case we have not been bootstrapped at that moment it did not get removed from the network.
- // So to be sure it gets removed we try to remove it now again.
- // In case it was removed earlier it will return early anyway inside the p2pDataStorage.
- removeMailboxEntryFromNetwork(mailboxItemsByUid.get(uid).getProtectedMailboxStorageEntry());
-
- // We will get called the onRemoved handler which triggers removeMailboxItemFromMap as well.
- // But as we use the uid from the decrypted data which is not available at onRemoved we need to
- // call removeMailboxItemFromMap here. The onRemoved only removes foreign mailBoxMessages.
- log.trace("## removeMailboxMsg uid={}", uid);
- removeMailboxItemFromLocalStore(uid);
+ if (mailboxItemsByUid.containsKey(uid)) {
</pre>
<p>Prefer early return</p>
<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/5072#pullrequestreview-568389215">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNSMGDH6YJQNMRAEMXDSZ4K47ANCNFSM4V43SQAA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNU5XVAVQ53JAIYMFOTSZ4K47A5CNFSM4V43SQAKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOEHQO4XY.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/5072#pullrequestreview-568389215",
"url": "https://github.com/bisq-network/bisq/pull/5072#pullrequestreview-568389215",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>