Loopring / loopring-wallet-feedback

钱包产品需求汇总(包括安卓和iOS)
10 stars 3 forks source link

Re-connecting a stale connection requires connected site to be refreshed twice in order to reconnect #174

Open sk33z3r opened 2 years ago

sk33z3r commented 2 years ago

Related to #167. I find myself needing to re-connect my wallet all the time because my phone will go to sleep and I have to refresh the stale connection in order to complete what I was trying to do.

At times, when I go to reconnect my wallet after it goes stale, I will not be presented with the QR code on the connected site to scan. I have to close out of the wallet on my phone, then refresh the connected site and try again for it to work.

I am working on nailing down a consistent repro and gif, but have been having troubles finding the right actions. I have had the issue occur twice to me today so far, and saw it several times over the past couple days when testing NFT minting and ENS stuff.

Below are the order of operations that I recall when the issues occurred, I will update as I figure out more. I'm not sure if this is an issue with the Loopring Wallet app, WalletConnect system, or the connected sites. I have had this occur to me on loopring.io, ens.domain, and OpenSea; and only with the Loopring Smart Wallet app. Using MetaMask doesn't show the issue, but I unfortunately do not have another wallet that uses WalletConnect to test with at the moment.

System:

Repro:

  1. Use WalletConnect to connect and unlock your wallet on loopring.io OBSERVE: User needs to check the box to confirm they understand the action
  2. Click around the UI and check out your balances, NFTs, or look at the markets. Allow the phone to go to sleep to trigger Bug 167.
  3. Try to complete an action (like Mint NFT) OBSERVE: Bug 167 is triggered, the connection is stale, no approval message is received
  4. Tap "Disconnect" in the mobile smart wallet OBSERVE: Loopring.io does not change, looks like the wallet is still connected
  5. In web UI, click your wallet address in top-right
  6. Click the tiny "Disconnect" button in the modal that appears OBSERVE: Loopring.io now changes and asks you to connect your wallet
  7. Click button to connect wallet OBSERVE: The checkbox observed unchecked at step 1 is now already checked
  8. Click the WalletConnect button

Expected: Modal changes and displays a QR code to complete the connection

Actual: Modal changes to a loading graphic and looks as though it is about to display a QR code, but never does

sk33z3r commented 2 years ago

I've just run into this again. It seems to be a timing thing and reliant on the mobile app closing itself after a certain period of time after the phone is locked. I'll try to confirm details with more attempts.

The actions were similar to the original repro, except at step 2 I wait a long amount of time instead of just enough to let the phone go to sleep.

Scenario:

  1. I'm sitting at home, finishing a coffee, and decide to mint an NFT on L2
  2. Connect my wallet, unlock funds, head to the NFT section
  3. Realize coffee is empty, get up and make another cup (maybe make a sandwich while I'm at it)
  4. Come back to the computer and I see the web app has disconnected me, asking to connect the wallet
  5. Click button to connect wallet

OBSERVE: I'm not presented with the option to choose MetaMask or WalletConnect. It immediately shows a loading graphic and looks like it will display a QR code, but I never see the QR code. I need to refresh the page to then get presented with the MetaMask/WalletConnect choice and receive a QR code.

sk33z3r commented 2 years ago

Ok, I think I just realized I've been misunderstanding where the issue actually occurs. Here's a new repro that seems to be the ticket:

  1. Connect and unlock wallet in web app with mobile wallet
  2. Do stuff on other websites, grab a coffee or snack, whatever. Just allow your phone to go to sleep and lock, then give enough time for the Android Wallet App to close itself. In my experience this takes ~15 min, but could be shorter intervals.
  3. Come back to the web app OBSERVE: The web app says you're still connected, but you need to Unlock the wallet again.
  4. Click the unlock button OBSERVE: Loading animation modal appears, but no signing message is ever received

This is when I need to go disconnect my wallet from the menu in the top-right of the web app, refresh the page, reopen my android wallet app, and then start the whole process from scratch to reconnect properly.

sk33z3r commented 2 years ago

I need to go back to the drawing board on this one. I just had this occurrence after having manually disconnected my wallet for a while:

  1. Open loopring.io fresh, just opened the browser
  2. Click Connect Wallet
  3. Check the box to agree to terms, choose WalletConnect OBSERVE: loading modal appears, but a QR code never appears

Once I refreshed and tried again it was OK.