[bisq-network/bisq] Redesign mailbox msg (#4784)

chimp1984 notifications at github.com
Thu Nov 12 04:26:54 CET 2020


This PR fixes an issue with not removed mailbox messages from the trade process.
I redesigned the way how we remove the messages. Instead of removing it from the network after successful processing we remove it immediately when we received it after the listeners are called. We keep it locally stored so in case the client was not ready to process it at that moment it  requests the data later. We also persist the messages for the edge case that the user shuts down the app before the client was ready for processing. In that case the message wuld be lost if not persisted as it was removed from the network but only kept in RAM for later access which is lost at restart. By persisting the data we get them again at restart.
After processing we also try to remove the data if still in the P2PDataStorage to be sure that the message got removed from the network if the initial removal failed because we have not been bootstrapped.

This PR did only the minimum of changes to limit risks for this release. We should clean up later a bit more and continue refactoring the mailbox message handling so it gets more robust and uniform. 
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Remove mailbox msg early from network
  * Add support for persisting MailboxMessageList

-- File Changes --

    M core/src/main/java/bisq/core/alert/PrivateNotificationManager.java (2)
    M core/src/main/java/bisq/core/proto/persistable/CorePersistenceProtoResolver.java (3)
    M core/src/main/java/bisq/core/setup/CorePersistedDataHost.java (2)
    M core/src/main/java/bisq/core/support/SupportManager.java (4)
    M core/src/main/java/bisq/core/trade/closed/CleanupMailboxMessages.java (8)
    M core/src/main/java/bisq/core/trade/protocol/TradeProtocol.java (10)
    M p2p/src/main/java/bisq/network/p2p/DecryptedMessageWithPubKey.java (33)
    A p2p/src/main/java/bisq/network/p2p/MailboxItem.java (53)
    A p2p/src/main/java/bisq/network/p2p/MailboxMessageList.java (76)
    M p2p/src/main/java/bisq/network/p2p/P2PService.java (168)
    M p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java (9)
    M proto/src/main/proto/pb.proto (15)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/4784.patch
https://github.com/bisq-network/bisq/pull/4784.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/4784
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20201111/fa39cd11/attachment.html>


More information about the bisq-github mailing list