[bisq-network/bisq-desktop] Ack messages for all trade, offer- and dispute messages (#1585)

Manfred Karrer notifications at github.com
Mon Jun 25 16:58:12 UTC 2018


We send AckMessages for all trade, offer and dispute messages.
The AckMessage gets sent back to the sender or a request after the request has been processed. If there is a response message expected to the request the response is sent before the AckMessage.
If the request cannot be processed an error will be sent back inside the AckMessage.
 when sent out as well as all 
The sending and receiving of all trade, offer, dispute and AckMessage messages is logged as well as the arrival state (Arrived at peer, stored in mailbox, failure).  
The all trade, offer and dispute messages have an offer or trade Id as well as an UID. The AckMessage carries the offer or trade Id as well as the sourceUID (the uid of the message we acknowledge). With the uid the message and the corresponding AckMessage can be linked.

For backward compatibility we must not send AckMessages to peers who have not updated.
To achieve that we use the Capabilities feature. But when sending a trade message we might not have already a connection open and thus don't know the peers capabilities (or the peer of offline and we cannot request the capabilities). To deal with that problem we use the Peer object and added the list of capabilities to be stored. With that solution we will likely have the trade peers capabilities already persisted via out peers list and if we send a new message only in the case the peer supports the AckMessage in his capabilities.
As the peer handling is rather dynamic we cannot guarantee that we will have the capabilities of the peer. So it can happen that we don't send the AckMessage in such cases.
As the AckMessage are an optional feature anyway missing AckMessages will not cause problems.

Peer who have not updated will never send a AckMessage, so specailly in the first days one should not expect that all messages get confirmed now.

For disputes in case of not acknowledged messages the users and arbitrators should send the message again.

## Trade messages
In the trade protocol we send the AckMessages at the complete or failed handlers of the TaskRunner. So it will be sent after the series of tasks a requests has triggered is completed.
 
### Trade protocol: Flow of messages 
<img width="1288" alt="screen shot 2018-06-20 at 21 34 24" src="https://user-images.githubusercontent.com/1449498/41863173-452204ae-78a6-11e8-834a-45160047ffed.png">

<img width="1317" alt="screen shot 2018-06-20 at 21 33 29" src="https://user-images.githubusercontent.com/1449498/41864196-5c558666-78a9-11e8-85b7-6efd04cf4fc9.png">

## UI
### Trade 
Fiat payment started message stored in mailbox:
<img width="1199" alt="screen shot 2018-06-25 at 18 37 15" src="https://user-images.githubusercontent.com/1449498/41863461-322d910a-78a7-11e8-8019-f2c630ee3ecd.png">

Fiat payment started message confirmed by peer (for both cases, direct or mailbox):
<img width="1185" alt="screen shot 2018-06-25 at 18 36 47" src="https://user-images.githubusercontent.com/1449498/41864175-49018984-78a9-11e8-85b9-83b41eaf90c4.png">

### Dispute messages
Message arrived at peer (direct msg) but not confirmed by peer:
<img width="1167" alt="screen shot 2018-06-23 at 16 10 35" src="https://user-images.githubusercontent.com/1449498/41863168-44c342ac-78a6-11e8-99e0-a9e4773785bc.png">

Message stored as mailbox msg (peer offline) - not confirmed by peer:
<img width="1171" alt="screen shot 2018-06-23 at 15 58 58" src="https://user-images.githubusercontent.com/1449498/41863170-45071090-78a6-11e8-87cf-ffc91d739fd4.png">

Message confirmed by peer (for both cases, direct or mailbox):
<img width="1168" alt="screen shot 2018-06-23 at 15 59 11" src="https://user-images.githubusercontent.com/1449498/41863169-44e8b65e-78a6-11e8-90a1-7ff3a076eec9.png">

Processing of message failed:
<img width="1169" alt="screen shot 2018-06-23 at 16 11 12" src="https://user-images.githubusercontent.com/1449498/41863166-44a9e154-78a6-11e8-9fb4-0a5834012c2a.png">


-- 
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-desktop/issues/1585
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20180625/2d21f1ba/attachment-0001.html>


More information about the bisq-github mailing list