Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sentry] TypeError: Cannot convert undefined value to object #11539

Closed
sentry-io bot opened this issue Oct 1, 2024 · 3 comments · Fixed by #11631
Closed

[Sentry] TypeError: Cannot convert undefined value to object #11539

sentry-io bot opened this issue Oct 1, 2024 · 3 comments · Fixed by #11631
Assignees
Labels
area-Sentry Issue from Sentry regression-prod-7.31.0 Regression bug that was found in production in release 7.31.0 release-7.34.0 Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing team-assets type-bug Something isn't working

Comments

@sentry-io
Copy link

sentry-io bot commented Oct 1, 2024

Sentry Issue: METAMASK-MOBILE-2RW0

TypeError: Cannot convert undefined value to object
  at TokenDetails (app/components/UI/AssetOverview/TokenDetails/TokenDetails.tsx:57:36)
  at normalizeTransactions (app/components/Views/Asset/index.js:428:20)
  at anonymous (app/components/Views/Asset/index.js:240:33)
...
(20 additional frame(s) were not displayed)

app/components/UI/AssetOverview/TokenDetails/TokenDetails.tsx in TokenDetails at line 57:36

  let tokenMetadata;
  let marketData;
  if (asset.isETH) {
    marketData = tokenExchangeRates[zeroAddress() as `0x${string}`];
  } else if (!asset.isETH && tokenContractAddress) {
    tokenMetadata = tokenList[tokenContractAddress.toLowerCase()];
    marketData = tokenExchangeRates[tokenContractAddress];
  } else {
    Logger.log('cannot find contract address');
@frankvonhoven frankvonhoven added Sev2-normal An issue that may lead to users misunderstanding some limited risks they are taking team-assets labels Oct 1, 2024
@metamaskbot metamaskbot changed the title TypeError: Cannot convert undefined value to object [Sentry] TypeError: Cannot convert undefined value to object Oct 2, 2024
@metamaskbot metamaskbot added type-bug Something isn't working area-Sentry Issue from Sentry regression-prod-7.31.0 Regression bug that was found in production in release 7.31.0 labels Oct 2, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Oct 2, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Oct 2, 2024
Copy link
Author

sentry-io bot commented Oct 3, 2024

Sentry Issue: METAMASK-MOBILE-2S26

@anaamolnar anaamolnar added Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing and removed Sev2-normal An issue that may lead to users misunderstanding some limited risks they are taking labels Oct 4, 2024
Copy link
Author

sentry-io bot commented Oct 4, 2024

Sentry Issue: METAMASK-MOBILE-2S6H

Copy link
Author

sentry-io bot commented Oct 4, 2024

Sentry Issue: METAMASK-MOBILE-2S4S

@gambinish gambinish self-assigned this Oct 4, 2024
github-merge-queue bot pushed a commit that referenced this issue Oct 4, 2024
## **Description**

Fixes token details view when tokenExchangeRates have not yet resolved,
or are simply undefined.

## **Related issues**

Fixes: #11539

## **Manual testing steps**

1. Go to `TokenDetails`
2. Hardcode `tokenExchangeRates` to `undefined`
3. App should not crash. Token details will be empty. Error was when
pressing native gas token, but also check others.

## **Screenshots/Recordings**

Bug:

<img width="300" alt="Screenshot 2024-10-04 at 10 39 05 AM"
src="https://github.com/user-attachments/assets/70f2eee5-08f1-4cec-b07c-fd6f544c8532">

Fix:

<img width="300" alt="Screenshot 2024-10-04 at 10 40 31 AM"
src="https://github.com/user-attachments/assets/05420c64-014f-43ae-90ba-d772cb421d9a">

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by team Oct 4, 2024
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by severity Oct 4, 2024
runway-github bot added a commit that referenced this issue Oct 4, 2024
## **Description**

Fixes token details view when tokenExchangeRates have not yet resolved,
or are simply undefined.

## **Related issues**

Fixes: #11539

## **Manual testing steps**

1. Go to `TokenDetails`
2. Hardcode `tokenExchangeRates` to `undefined`
3. App should not crash. Token details will be empty. Error was when
pressing native gas token, but also check others.

## **Screenshots/Recordings**

Bug:

<img width="300" alt="Screenshot 2024-10-04 at 10 39 05 AM"
src="https://github.com/user-attachments/assets/70f2eee5-08f1-4cec-b07c-fd6f544c8532">

Fix:

<img width="300" alt="Screenshot 2024-10-04 at 10 40 31 AM"
src="https://github.com/user-attachments/assets/05420c64-014f-43ae-90ba-d772cb421d9a">

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
runway-github bot added a commit that referenced this issue Oct 4, 2024
## **Description**

Fixes token details view when tokenExchangeRates have not yet resolved,
or are simply undefined.

## **Related issues**

Fixes: #11539

## **Manual testing steps**

1. Go to `TokenDetails`
2. Hardcode `tokenExchangeRates` to `undefined`
3. App should not crash. Token details will be empty. Error was when
pressing native gas token, but also check others.

## **Screenshots/Recordings**

Bug:

<img width="300" alt="Screenshot 2024-10-04 at 10 39 05 AM"
src="https://github.com/user-attachments/assets/70f2eee5-08f1-4cec-b07c-fd6f544c8532">

Fix:

<img width="300" alt="Screenshot 2024-10-04 at 10 40 31 AM"
src="https://github.com/user-attachments/assets/05420c64-014f-43ae-90ba-d772cb421d9a">

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
runway-github bot pushed a commit that referenced this issue Oct 4, 2024
## **Description**

Fixes token details view when tokenExchangeRates have not yet resolved,
or are simply undefined.

## **Related issues**

Fixes: #11539

## **Manual testing steps**

1. Go to `TokenDetails`
2. Hardcode `tokenExchangeRates` to `undefined`
3. App should not crash. Token details will be empty. Error was when
pressing native gas token, but also check others.

## **Screenshots/Recordings**

Bug:

<img width="300" alt="Screenshot 2024-10-04 at 10 39 05 AM"
src="https://github.com/user-attachments/assets/70f2eee5-08f1-4cec-b07c-fd6f544c8532">

Fix:

<img width="300" alt="Screenshot 2024-10-04 at 10 40 31 AM"
src="https://github.com/user-attachments/assets/05420c64-014f-43ae-90ba-d772cb421d9a">

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Cal-L pushed a commit that referenced this issue Oct 4, 2024
## **Description**

Fixes token details view when tokenExchangeRates have not yet resolved,
or are simply undefined.

## **Related issues**

Fixes: #11539

## **Manual testing steps**

1. Go to `TokenDetails`
2. Hardcode `tokenExchangeRates` to `undefined`
3. App should not crash. Token details will be empty. Error was when
pressing native gas token, but also check others.

## **Screenshots/Recordings**

Bug:

<img width="300" alt="Screenshot 2024-10-04 at 10 39 05 AM"
src="https://github.com/user-attachments/assets/70f2eee5-08f1-4cec-b07c-fd6f544c8532">

Fix:

<img width="300" alt="Screenshot 2024-10-04 at 10 40 31 AM"
src="https://github.com/user-attachments/assets/05420c64-014f-43ae-90ba-d772cb421d9a">

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Cal-L added a commit that referenced this issue Oct 4, 2024
## **Description**

Fixes token details view when tokenExchangeRates have not yet resolved,
or are simply undefined.

## **Related issues**

Fixes: #11539

## **Manual testing steps**

1. Go to `TokenDetails`
2. Hardcode `tokenExchangeRates` to `undefined`
3. App should not crash. Token details will be empty. Error was when
pressing native gas token, but also check others.

## **Screenshots/Recordings**

Bug:

<img width="300" alt="Screenshot 2024-10-04 at 10 39 05 AM"
src="https://github.com/user-attachments/assets/70f2eee5-08f1-4cec-b07c-fd6f544c8532">

Fix:

<img width="300" alt="Screenshot 2024-10-04 at 10 40 31 AM"
src="https://github.com/user-attachments/assets/05420c64-014f-43ae-90ba-d772cb421d9a">

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding

Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

Co-authored-by: Nick Gambino <[email protected]>
metamaskbot pushed a commit that referenced this issue Oct 7, 2024
## **Description**

Fixes token details view when tokenExchangeRates have not yet resolved,
or are simply undefined.

## **Related issues**

Fixes: #11539

## **Manual testing steps**

1. Go to `TokenDetails`
2. Hardcode `tokenExchangeRates` to `undefined`
3. App should not crash. Token details will be empty. Error was when
pressing native gas token, but also check others.

## **Screenshots/Recordings**

Bug:

<img width="300" alt="Screenshot 2024-10-04 at 10 39 05 AM"
src="https://github.com/user-attachments/assets/70f2eee5-08f1-4cec-b07c-fd6f544c8532">

Fix:

<img width="300" alt="Screenshot 2024-10-04 at 10 40 31 AM"
src="https://github.com/user-attachments/assets/05420c64-014f-43ae-90ba-d772cb421d9a">

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
sahar-fehri pushed a commit that referenced this issue Oct 9, 2024
## **Description**

Fixes token details view when tokenExchangeRates have not yet resolved,
or are simply undefined.

## **Related issues**

Fixes: #11539

## **Manual testing steps**

1. Go to `TokenDetails`
2. Hardcode `tokenExchangeRates` to `undefined`
3. App should not crash. Token details will be empty. Error was when
pressing native gas token, but also check others.

## **Screenshots/Recordings**

Bug:

<img width="300" alt="Screenshot 2024-10-04 at 10 39 05 AM"
src="https://github.com/user-attachments/assets/70f2eee5-08f1-4cec-b07c-fd6f544c8532">

Fix:

<img width="300" alt="Screenshot 2024-10-04 at 10 40 31 AM"
src="https://github.com/user-attachments/assets/05420c64-014f-43ae-90ba-d772cb421d9a">

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Sentry Issue from Sentry regression-prod-7.31.0 Regression bug that was found in production in release 7.31.0 release-7.34.0 Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing team-assets type-bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants