[bisq-network/bisq] (2/4) [BUGFIX] Call correct remove function in addMailboxData failure path. (#3556)

Julian Knutsen notifications at github.com
Mon Nov 4 19:22:15 UTC 2019


Fix a bug where remove() was called instead of removeMailboxData() and
guard against future callers doing the same thing.

Additionally, fix a potential bug where the sequence number for the
remove was not incremented leading to unexpected add after remove behavior
documented in P2PDataStorageTest::addProtectectedStorageEntry_afterRemoveSameSeqNr().

For mailbox messages, this wouldn't actually be a problem due to the
AddOncePayload behavior, but all removes now increase the sequence number
making refactoring and analysis easier.
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/3556

-- Commit Summary --

  * [TESTS] Add tests for P2PDataStorage in order to safely refactor
  * [BUGFIX] Call correct remove function in addMailboxData failure path.

-- File Changes --

    M build.gradle (1)
    M core/src/main/java/bisq/core/alert/Alert.java (2)
    M p2p/src/main/java/bisq/network/p2p/P2PService.java (10)
    M p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java (6)
    M p2p/src/test/java/bisq/network/p2p/storage/P2PDataStorageTest.java (1491)
    A p2p/src/test/java/bisq/network/p2p/storage/mocks/AppendOnlyDataStoreServiceFake.java (42)
    A p2p/src/test/java/bisq/network/p2p/storage/mocks/DateTolerantPayloadStub.java (50)
    A p2p/src/test/java/bisq/network/p2p/storage/mocks/PersistableNetworkPayloadStub.java (43)
    A p2p/src/test/java/bisq/network/p2p/storage/mocks/ProtectedDataStoreServiceFake.java (45)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/3556.patch
https://github.com/bisq-network/bisq/pull/3556.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/3556
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191104/256c7827/attachment-0001.html>


More information about the bisq-github mailing list