Uniswap / Uniswap/interface

Locking account doesn't fully disconnect the user from the application

Open
#2,350 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug p1
Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Bug Description
When a user disconnects their mm the injected provider still returns their account 0 information. The provider appears to still be accessible. (We can still get L2 quotes, for example.) Things fall apart when the user attempts to construct a transaction (see screenshot).

image

Only at this point does mm return null for active account, etc.

Steps to Reproduce

  1. Go to app.uniswap.org
  2. Unlock metamask
  3. connect an account
  4. lock metamask
  5. input swap info
  6. attempt swap
  7. observe error

Expected Behavior
User's account info should be disabled immediately when the user locks their account.

Additional Context
This seems like a metamask bug, but we may be able to get around it if metamask emits events on lock. @NoahZinsmeister is looking into this rn.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the flow at app.uniswap.org: unlock MetaMask, connect an account, lock MetaMask, then enter swap details and attempt a swap. Investigate how the application detects account locking and whether MetaMask emits an event; done means the account is disabled immediately after locking and the reported transaction error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.