anza-xyz / wallet-adapter

Modular TypeScript wallet adapters and components for Solana applications.
https://anza-xyz.github.io/wallet-adapter/
Apache License 2.0
1.59k stars 960 forks source link

Sollet Extension Timeout #354

Closed kierangillen closed 2 years ago

kierangillen commented 2 years ago

Describe the bug When connecting with Sollet extension, Sollet will display a "Allow this site to access your Solana account?" page with a Connect CTA. If you don't click the Connect button immediately the request fails with WalletTimeoutError.

To Reproduce Steps to reproduce the behavior:

  1. Connect using Sollet Wallet Extension for the first time
  2. Sollet Extension displays page with title "Allow this site to access your Solana account?"
  3. Wait more than 3 seconds, the request to connect throws an error, WalletTimeoutError
  4. If you click Connect quickly the request works as expected

Desktop:

jordaaash commented 2 years ago

Hmm. So the default timeout should be 10 seconds: https://github.com/solana-labs/wallet-adapter/blob/e89adf6cdc59ca33db0fcc3a27841a1f94a8b8ed/packages/wallets/sollet/src/base.ts#L51

The timeout is set here: https://github.com/solana-labs/wallet-adapter/blob/e89adf6cdc59ca33db0fcc3a27841a1f94a8b8ed/packages/wallets/sollet/src/base.ts#L157-L158

This hack is unfortunate but Sollet sucks and there is no way to tell if the window has been closed, unlike Phantom and most other wallets.

Is any config being passed to the adapter?

kierangillen commented 2 years ago

I was using your example settings:

new SolletExtensionWalletAdapter({ network }),

We could just chalk this up to an issue with Sollet and move on. Thanks for looking into it, and probably good to be aware of it.