Skip to content

Update WalletConnect Provider to 6.1.5#1730

Merged
radumojic merged 1 commit intodevelopmentfrom
rm/update-wallet-connect-6.1.5
Mar 27, 2026
Merged

Update WalletConnect Provider to 6.1.5#1730
radumojic merged 1 commit intodevelopmentfrom
rm/update-wallet-connect-6.1.5

Conversation

@radumojic
Copy link
Copy Markdown
Contributor

Issue/Feature

  • Update WalletConnect Provider to 6.1.5

Reproduce

Issue exists on version 2. of sdk-dapp.

Root cause

Fix

Additional changes

Contains breaking changes

  • No
  • Yes

Updated CHANGELOG

  • No
  • Yes

Testing

  • User testing
  • Unit tests

@radumojic radumojic merged commit 82107bc into development Mar 27, 2026
2 checks passed
@radumojic radumojic deleted the rm/update-wallet-connect-6.1.5 branch March 27, 2026 13:54
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the @multiversx/sdk-wallet-connect-provider dependency to version 6.1.5, increments the package version to 5.6.23, and updates the changelog. A critical issue was identified in the WalletConnect provider strategy where recursive calls in the reconnect method's error handler could lead to an infinite loop and application instability.

Comment thread package.json
"@multiversx/sdk-hw-provider": "8.1.2",
"@multiversx/sdk-native-auth-client": "2.0.1",
"@multiversx/sdk-wallet-connect-provider": "6.1.4",
"@multiversx/sdk-wallet-connect-provider": "6.1.5",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

While updating this dependency, I noticed a potential critical issue in src/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.ts that could lead to an infinite loop and application instability.

In the login method, if the initial login attempt fails, it calls reconnect(). The reconnect() method itself has a catch block that recursively calls reconnect() on any failure. This will cause an infinite loop if the connection or login continues to fail (for example, if the user repeatedly rejects the connection).

Here's the problematic code:

In login():

// src/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.ts:257
    } catch (error) {
      console.error(WalletConnectV2Error.userRejected, error);
      return await reconnect();
    }

In reconnect():

// src/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.ts:237
      } catch {
        return await reconnect();
      }

To prevent this, I recommend removing the recursive call within the catch block of reconnect and instead re-throwing the error to be handled by the caller. This will prevent the infinite loop.

Suggested change in reconnect():

// src/providers/strategies/WalletConnectProviderStrategy/WalletConnectProviderStrategy.ts:237
      } catch (err) {
        console.error('WalletConnect reconnect failed', err);
        throw err;
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants