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.61k stars 962 forks source link

localstorage sometimes behaves strangely #977

Open lucian55 opened 5 months ago

lucian55 commented 5 months ago

When I use Phantom to connect to my wallet, the walletName in localstorage is set to "Phantom", which is normal. When I refresh the page, "Phantom" sometimes becomes "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Phantom\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\"\\\"\""

It happens occasionally, not necessarily. What's going on?

lucian55 commented 5 months ago

I know the reason. For the same website, open two tabs, one using Phantom and the other disabling Phantom. Refreshing the disabled tab will cause the value of localstorage to be reset to "\"Phantom\""

mcintyre94 commented 4 months ago

@lucian55 Could you give more information on how to reproduce this? If you can give step-by-step instructions using https://anza-xyz.github.io/wallet-adapter/example/ that'd be great!