trustbloc / wallet

Wallet implementation based on agent-sdk
Apache License 2.0
24 stars 23 forks source link

Remove retry option (Wallet - edge-adapter/hub-router message) #478

Closed rolsonquadras closed 3 years ago

rolsonquadras commented 4 years ago

Scenario: The edge-adapter/hub-router provides the DIDComm invitation to the wallet. Once DIDExchange is complete the wallet need to call other DIDComm Messages in edge-adapter/hub-router. During the DIDExchange protocol, the wallet's state gets updated to "completed" and sends an ack to edge-adapter/hub-router. But before edge-adapter/hub-router could update its state to "completed", it gets a new message from wallet and the message fails as it doesn't recognize the sender as the DIDExchange state is not yet completed.

Current workaround: On failure, the wallet retries again to send the message. When edge-adapter/hub-router is backed by MySQL, wallet has to retry most of the times. Also, these retries happen after a time (currently 5 sec). Ref - https://github.com/trustbloc/edge-agent/pull/457/files

Possible Solution: Once edge-adapter/hub-router updates the DIDExchange state to completed, it can send back a message to wallet. Once wallet receives this, it can start its processing (sending new message to edge-adapter/hub-router).

sudeshrshetty commented 4 years ago

According to this above logic is going to be moved to agent-sdk.

Since hub-router is not mandatory feature in agent-sdk (conventional aries router can also be used), not sure if have to force mediatorclient.connect() command to use notification from above message type.

Another option : is to keep this logic back in edge-agent webwallet api, and perform only mediator connect operation in agent-sdk

sudeshrshetty commented 3 years ago

done