Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The WalletConnect SDK attempts to send traffic over a disconnected socket connection #1399

Open
marctatham opened this issue May 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@marctatham
Copy link

Describe the bug
The WalletConnect SDK attempts to send traffic over a disconnected socket connection.

SDK Version

  • Client: [e.g. Kotlin]
  • Version [e.g. 22]

To Reproduce
Steps to reproduce the behavior:
As this is behaviour internal to the CoreCommonModule, it is difficult. But I can describe the steps that I believe incurred this behaviour.

  • initialise CoreClient to use ConnectionType.MANUAL
  • for your Dapp's interactions with WalletConnect, ensure the behaviour is
    • establish socket connection
    • perform action (connect wallet/sign request/disconnect wallet)
    • disconnect socket connection
      In particular the logs were after performing a disconnect wallet event

Expected behavior
If the socket connection is not active, the SDK should not be trying to send requests over it.

Screenshots
No screenshot, but the logs are more useful here anyway

11:53:02.131 DappDelegate          V  onConnectionStateChange ConnectionState(isAvailable=false)
11:53:02.132 WalletCon...taSource  V  [disconnectSocket] disconnected
11:53:02.695 VRI[WalletActivity]   D  visibilityChanged oldVisibility=true newVisibility=false
11:53:02.695 VRI[Pop-up window]    D  visibilityChanged oldVisibility=true newVisibility=false
11:53:02.740 VRI[LoginActivity]    D  visibilityChanged oldVisibility=true newVisibility=false
11:53:04.150 FA                    I  Application backgrounded at: timestamp_millis: 1715939582146
11:53:25.580 CoreCommo...onModule  E  Unsubscribe to topic: Topic(value=28a29f690e9ea0a36e2bf19caff574c39968349ed875dd29da62d0c6d1a0ca9a) error: kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 60000 ms

Device (please complete the following information):

  • Device: Pixel 6
  • OS: Android 14
  • Version AP31.240322.027

Additional context
While I'm able to more easily reproduce this in context of my application is configured to manually determine when to open/close the socket connect, this highlights that this will likely happen in the case of ConnectionType.AUTOMATIC where the SDK attempts to ensure the socket is remained open.

@marctatham marctatham added the bug Something isn't working label May 17, 2024
@marctatham
Copy link
Author

While this does not immediately appear to affect the standard operation of WalletConnect, the behaviour I have observed is that WalletConnect performs worse when you have a lot of active sessions with a particular wallet (by that i mean higher rate of the wallet not displaying the sign request, and stuff like this)

So I guess the concern I have here is that the SDK's failure to properly cleanup after itself, doesn't appear to be retried at a later stage. And while this doesn't manifest in an immediate degradation of WalletConnect performance, over time, while accumulating more active sessions with a particular wallet, this can have an effect (on some wallets more than others, such as Metamask)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant