This PR addresses multiple instances of failed subscriptions cleanup in Beacon; also there is no need to undergo a big refactor.
Namely I found 3 issues:
The Client instance once it had subscribed to the transport, it never cleared its subscriptions. Now we keep track of each subscription and remove each one of them on Client destroy (this needs to be managed on the client instance not on the transport one)
WalletConnectCommunication client never cleared its subscriptions maps when closing the client
Because we are subscribing to WC session events, DAppClient wouldn’t behave correctly while receiving an event (session_update for instance) because our logic assumed that we would have always end up in a one direction flow (one request from the dApp, one response from the Wallet). However, this is no longer true and there is the need to separately acknowledge messages coming from session events.
This PR addresses multiple instances of failed subscriptions cleanup in Beacon; also there is no need to undergo a big refactor. Namely I found 3 issues:
Client
instance once it had subscribed to the transport, it never cleared its subscriptions. Now we keep track of each subscription and remove each one of them on Client destroy (this needs to be managed on the client instance not on the transport one)session_update
for instance) because our logic assumed that we would have always end up in a one direction flow (one request from the dApp, one response from the Wallet). However, this is no longer true and there is the need to separately acknowledge messages coming from session events.