MetaMask / MetaMask/metamask-extension

[Bug]: MM breaks with the error `Cannot read properties of undefined (reading 'balance')`

Open
#23,344 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

INVALID-ISSUE-TEMPLATE Sev3-low team-confirmations Transactions type-bug
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

Describe the bug

Problem: whenever I trigger a Get Encryption Key request from a dapp and a subsequent transaction, MetaMask breaks with the error Cannot read properties of undefined (reading 'balance')

Expected behavior

  • MM should not break
  • We should display the subsequent tx

Screenshots/Recordings

Screenshot from 2024-03-06 14-43-13

https://github.com/MetaMask/metamask-extension/assets/54408225/fa660603-674d-490f-bb9d-4e742cf36aa3

Steps to reproduce

  1. Go to the test dapp
  2. Trigger Get Encryption Key
  3. Without accepting nor rejecting, trigger a transaction
  4. Reject the Get Encryption Key request
  5. See wallet breaks

Version

11.10.0 but possibly earlier

Build type

None

Browser

Chrome

Operating system

Linux

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 with the test dapp and reproduce the sequence of requesting an encryption key, triggering a transaction, and rejecting the key request. Trace the request and transaction handling around the reported undefined balance error; done means the wallet does not break and the subsequent transaction is displayed.

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.