solana-mobile / mobile-wallet-adapter

Other
250 stars 104 forks source link

[Wallet Request] Enable user to change mismatched cluster during authorization #472

Open Michaelsulistio opened 1 year ago

Michaelsulistio commented 1 year ago

Issue Currently, if the wallet app's configured cluster is mismatched with the dApp's request (devnet vs testnet), then the request is either denied and user is informed (Phantom) and or silently fails (Solflare).

This is poor UX for dapp users who could be using new dApps that are in beta and still in devnet mode. These users would be forced to manually change clusters each time they use a different dApp.

Repro Phantom Solflare Ultimate
image Silently fails after this image Does not support devnet/testnet

Proposal/Fix When there is a cluster mismatch during authorization, give the user an option to change their configured cluster immediately in the auth flow.

At the very least, users should know why its failing and should not have silent failures like in Solflare.

Funkatronics commented 1 year ago

When there is a cluster mismatch during authorization, give the user an option to change their configured cluster immediately in the auth flow.

The authorization request issued by a dapp includes a cluster field. So the auth token should only be considered valid for that specified cluster. So I would add the following details here:

When there is a cluster mismatch during authorization...

Some other thoughts:

d-reader-josip commented 1 year ago

if there is a mismatch, wallets can choose how to handle this but should either allow the user to switch to the correct cluster (the one that was authorized), or show an error informing the user of the mismatch.

Please lets focus on the "allow the user to switch to the correct cluster" approach, dApps which rely on network switching have really poor user experience. Lets not throw errors everywhere (build walls), instead we should give users the option to "proceed with caution"