<p>Fix a bug where remove() was called instead of removeMailboxData() and<br>
guard against future callers doing the same thing.</p>
<p>Additionally, fix a potential bug where the sequence number for the<br>
remove was not incremented leading to unexpected add after remove behavior<br>
documented in P2PDataStorageTest::addProtectectedStorageEntry_afterRemoveSameSeqNr().</p>
<p>For mailbox messages, this wouldn't actually be a problem due to the<br>
AddOncePayload behavior, but all removes now increase the sequence number<br>
making refactoring and analysis easier.</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/3556'>https://github.com/bisq-network/bisq/pull/3556</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>[TESTS] Add tests for P2PDataStorage in order to safely refactor</li>
  <li>[BUGFIX] Call correct remove function in addMailboxData failure path.</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3556/files#diff-0">build.gradle</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3556/files#diff-1">core/src/main/java/bisq/core/alert/Alert.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3556/files#diff-2">p2p/src/main/java/bisq/network/p2p/P2PService.java</a>
    (10)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3556/files#diff-3">p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3556/files#diff-4">p2p/src/test/java/bisq/network/p2p/storage/P2PDataStorageTest.java</a>
    (1491)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3556/files#diff-5">p2p/src/test/java/bisq/network/p2p/storage/mocks/AppendOnlyDataStoreServiceFake.java</a>
    (42)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3556/files#diff-6">p2p/src/test/java/bisq/network/p2p/storage/mocks/DateTolerantPayloadStub.java</a>
    (50)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3556/files#diff-7">p2p/src/test/java/bisq/network/p2p/storage/mocks/PersistableNetworkPayloadStub.java</a>
    (43)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3556/files#diff-8">p2p/src/test/java/bisq/network/p2p/storage/mocks/ProtectedDataStoreServiceFake.java</a>
    (45)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/3556.patch'>https://github.com/bisq-network/bisq/pull/3556.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/3556.diff'>https://github.com/bisq-network/bisq/pull/3556.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/3556?email_source=notifications&email_token=AJFFTNSO6TL5KJBRDFH2POLQSBY6PA5CNFSM4JIYAKSKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWWEQ2A">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNRTJ6D2PGBDROYNBSTQSBY6PANCNFSM4JIYAKSA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNR5WEIKWQAGVY73PXLQSBY6PA5CNFSM4JIYAKSKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWWEQ2A.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/3556?email_source=notifications\u0026email_token=AJFFTNSO6TL5KJBRDFH2POLQSBY6PA5CNFSM4JIYAKSKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWWEQ2A",
"url": "https://github.com/bisq-network/bisq/pull/3556?email_source=notifications\u0026email_token=AJFFTNSO6TL5KJBRDFH2POLQSBY6PA5CNFSM4JIYAKSKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWWEQ2A",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>