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

fix: Token details should not display zero balance for tokens without marketData #29299

Merged
merged 4 commits into from
Dec 18, 2024

Conversation

gambinish
Copy link
Contributor

@gambinish gambinish commented Dec 17, 2024

Description

On main asset list, if a token doesn't have marketData, we do not display the fiat value. On tokenDetails we were falling back to zero balance (this is incorrect)

This PR adds a fix to not fallback to zero balance, and to instead simply omit the value.

Open in GitHub Codespaces

Related issues

Fixes: #29244

Manual testing steps

  1. Add a memcoin without marketData
  2. Validate that no fiat value is shown on main asset list
  3. Validate that no fiat value is shown on token details (should not display zero value)
  4. Ensure nothing results in NaN value.

Screenshots/Recordings

Before

Screenshot 2024-12-17 at 1 39 10 PM Screenshot 2024-12-17 at 1 39 26 PM

After

Screenshot 2024-12-17 at 1 34 09 PM Screenshot 2024-12-17 at 1 34 26 PM

Pre-merge author checklist

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.

…defined is the correct value, for instance when marketData doesn't exist
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link

sentry-io bot commented Dec 17, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: ui/components/app/wallet-overview/coin-buttons.tsx

Function Unhandled Issue
setCorrectChain Error: Had a problem changing networks! /popup.html
Event Count: 3 Affected Users: 0

Did you find this useful? React with a 👍 or 👎

@gambinish gambinish marked this pull request as ready for review December 17, 2024 21:54
@metamaskbot
Copy link
Collaborator

Builds ready [d9c2791]
Page Load Metrics (1825 ± 89 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15712381182218689
domContentLoaded15622368179818689
load15712384182518489
domInteractive20194494421
backgroundConnect107726188
firstReactRender1782532311
getState56117189
initialActions01000
loadScripts11631938136818790
setupStore68614199
uiStartup179427942088245117
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -71 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@bergeron
Copy link
Contributor

bergeron commented Dec 17, 2024

Screenshot 2024-12-17 at 2 29 40 PM

I was trying to follow testing steps, but for some reason I'm seeing $0.00 on the main token list 🤔

nevermind, the repro is a token without market data, not a token without balance. Have to pick some obscure token that we don't have prices for.

Screenshot 2024-12-17 at 2 35 57 PM

Update: LGTM, tested before and after

@gambinish gambinish requested a review from bergeron December 17, 2024 22:41
@metamaskbot
Copy link
Collaborator

Builds ready [b2a79e5]
Page Load Metrics (1800 ± 75 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15992271180216479
domContentLoaded15792199177415775
load15992216180015775
domInteractive268944199
backgroundConnect126928209
firstReactRender1797382512
getState65821199
initialActions01000
loadScripts11181653132413364
setupStore76818199
uiStartup179826822071234112
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 12 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@gambinish gambinish added this pull request to the merge queue Dec 18, 2024
Merged via the queue into main with commit bdd9243 Dec 18, 2024
77 checks passed
@gambinish gambinish deleted the fix/29244-zero-balance-token-details branch December 18, 2024 17:29
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2024
@metamaskbot metamaskbot added the release-12.11.0 Issue or pull request that will be included in release 12.11.0 label Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.11.0 Issue or pull request that will be included in release 12.11.0 team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: $0 balance amount not shown on some assets in Extension asset list
5 participants