hippospace/aptos-wallet-adapter

WalletNotReadyError on page refresh with autoconnect=true

flappys opened this issue · 4 comments

With autoconnect enabled to true and wallet connected, we get WalletNotReadyError on page refresh. It redirects to the chrome extension page of that connected wallet.

Console output:

selectedWallets {adapter: MartianWalletAdapter, readyState: 'NotDetected'}
App.tsx:56 wallet errors:  WalletNotReadyError
    at WalletProvider.tsx:243:1
    at commitHookEffectListMount (react-dom.development.js:23150:1)
    at commitPassiveMountOnFiber (react-dom.development.js:24926:1)
    at commitPassiveMountEffects_complete (react-dom.development.js:24891:1)
    at commitPassiveMountEffects_begin (react-dom.development.js:24878:1)
    at commitPassiveMountEffects (react-dom.development.js:24866:1)
    at flushPassiveEffectsImpl (react-dom.development.js:27039:1)
    at flushPassiveEffects (react-dom.development.js:26984:1)
    at react-dom.development.js:26769:1
    at workLoop (scheduler.development.js:266:1)

Can you provide more info of the issue / try the latest version of the adapter? I can't reproduce the issue in wallet-tester

Steps followed: node -version: v18.7.0

  1. git clone https://github.com/hippospace/aptos-wallet-adapter.git
  2. copy the wallet tester folder and to another directory
  3. update the package.json with "@manahippo/aptos-wallet-adapter": "^0.4.9"
  4. yarn start - and then select autoconnect to true, login and then refresh.
  5. It opens a tab with the above error.

Also not related to this. The code used to verify signed mesaage needs a little change. The signature that is returned from martian contains a '0x' and it needs to be removed before calling the nacl verify.

Update: Just wanted to be sure if I was doing some mistake using the adapter. Went back to 0.4.0 till 0.4.3 and everything worked fine. Updated the package to 0.4.4 and boom the error happened.

Reason:
8741314#diff-6ee148f955478e563170a98d7cd134d54dd80c9ad95bced15a5e411afc8d90a2

Got it. will restore to the previous version and figure out the best solution for this part