Skip to content

fix: corrupted tokens state #30046

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

Merged
merged 3 commits into from
Feb 3, 2025
Merged

fix: corrupted tokens state #30046

merged 3 commits into from
Feb 3, 2025

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Feb 2, 2025

Description

Balances should be displayed on the swap from picker

core PR: MetaMask/core#5257

Open in GitHub Codespaces

Related issues

Fixes: #30040

Manual testing steps

  1. Choose popular network on the network tokens filter
  2. Click on swap button
  3. balances should be displayed on the from and to picker

Screenshots/Recordings

Before

After

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.

Copy link
Contributor

github-actions bot commented Feb 2, 2025

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.

@salimtb salimtb force-pushed the fix/fix-corrupted-tokens-state branch from 6182ec8 to 13423d6 Compare February 2, 2025 02:19
@salimtb salimtb changed the title Fix/fix corrupted tokens state fix corrupted tokens state Feb 2, 2025
@salimtb salimtb added the needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. label Feb 2, 2025
@salimtb salimtb changed the title fix corrupted tokens state fix: corrupted tokens state Feb 2, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [2533ea7]
Page Load Metrics (1561 ± 52 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint42617611495260125
domContentLoaded14031842154310551
load14111893156110952
domInteractive2381392110
backgroundConnect992272210
firstReactRender1567292010
getState45316178
initialActions01000
loadScripts1002137211128541
setupStore785272613
uiStartup16392192180117785
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 4.5 KiB (0.08%)
  • ui: 0 Bytes (0.00%)
  • common: 20 Bytes (0.00%)

@salimtb salimtb marked this pull request as ready for review February 2, 2025 13:00
@metamaskbot
Copy link
Collaborator

Builds ready [3e25c4f]
Page Load Metrics (1617 ± 37 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint36817551559284136
domContentLoaded1431171215967837
load1489175816177837
domInteractive237333136
backgroundConnect106524189
firstReactRender1589442813
getState45911147
initialActions01000
loadScripts1032124411287134
setupStore85711115
uiStartup16522283183914168
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 4.52 KiB (0.08%)
  • ui: 0 Bytes (0.00%)
  • common: 20 Bytes (0.00%)

@@ -19,3 +19,50 @@ index 017fb94055b64f99c75f8d54b763a501bdd03e97..34396ba143e3ebcb04fa2c80f7a35d1a
// We want to ensure that the CID is v1 (https://docs.ipfs.io/concepts/content-addressing/#identifier-formats)
// because most cid v0s appear to be incompatible with IPFS subdomains
return {
diff --git a/dist/TokensController.cjs b/dist/TokensController.cjs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also update the .mjs file as well for webpack builds?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually updating the cjs file is enough when we create patch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm as long as this passes CI (webpack builds use mjs).

I'm guessing we will release a new version soon.

@salimtb salimtb added this pull request to the merge queue Feb 3, 2025
Merged via the queue into main with commit 74fd73c Feb 3, 2025
76 checks passed
@salimtb salimtb deleted the fix/fix-corrupted-tokens-state branch February 3, 2025 15:39
@github-actions github-actions bot locked and limited conversation to collaborators Feb 3, 2025
@metamaskbot metamaskbot added the release-12.13.0 Issue or pull request that will be included in release 12.13.0 label Feb 3, 2025
@sleepytanya
Copy link
Contributor

Still reproducing for both Current and Popular network views:

zero_balance.mov

@darkwing
Copy link
Contributor

darkwing commented Feb 14, 2025

1️⃣ What was the issue?

The token list was not refreshing correctly.

2️⃣ Why did it happen and why wasn’t it caught earlier?

Refresh issue appeared to be caused by a missing dependency in the useEffect, suggesting that it was an existing bug.

3️⃣ What actions are we taking to prevent this in the future?

Fix was merged.

4️⃣ Any related tickets and ETAs for follow-up actions?

  • We should update an existing E2E to check for displayed balance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-12.13.0 Issue or pull request that will be included in release 12.13.0 team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Swap is showing zero balance for ERC20 tokens, user are unable to swap
6 participants