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: 🐛 fix insufficient funds displays incorrect native token #29828

Merged

Conversation

matteoscurati
Copy link
Contributor

@matteoscurati matteoscurati commented Jan 21, 2025

Description

This PR addresses an issue where the "Insufficient funds" alert incorrectly displayed "ETH" as the native token, regardless of the actual network's native token #28867. This was observed when users attempted to initiate a transaction on networks with a different native token, such as Polygon, where "POL" should be displayed instead of "ETH".

Open in GitHub Codespaces

Related issues

#28867

Manual testing steps

  1. Select Polygon
  2. Trigger a dapp tx with an account without funds (you can use these tests https://metamask.github.io/test-dapp/)
  3. Click on the Alert
  4. See POL as the token name

Screenshots/Recordings

Before

After

https://www.loom.com/share/8dd8001fc8d44da3b77e52a4877427f8

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

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.

@metamaskbot
Copy link
Collaborator

Builds ready [969744b]
Page Load Metrics (1681 ± 73 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14552122168115273
domContentLoaded14482109166815172
load14562122168115273
domInteractive24139492512
backgroundConnect65215136
firstReactRender1575432512
getState410621
initialActions0452105
loadScripts10481653123113465
setupStore66112168
uiStartup16652415193118287
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -1.65 KiB (-0.03%)
  • ui: 189 Bytes (0.00%)
  • common: -2 Bytes (-0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [537f5ed]
Page Load Metrics (1825 ± 138 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint149325271828283136
domContentLoaded148525031803281135
load149425731825287138
domInteractive26169663919
backgroundConnect66622178
firstReactRender1692442813
getState57215188
initialActions01000
loadScripts108320051365248119
setupStore662192110
uiStartup180229012133288138
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 192 Bytes (0.00%)
  • common: -2 Bytes (-0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [776040a]
Page Load Metrics (1956 ± 77 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17072268196016077
domContentLoaded16622254192916378
load17022265195616077
domInteractive278142178
backgroundConnect116524178
firstReactRender17100352512
getState783292412
initialActions01000
loadScripts12081730144015072
setupStore764232211
uiStartup196628862264223107
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 192 Bytes (0.00%)
  • common: -2 Bytes (-0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [bb5ff52]
Page Load Metrics (1747 ± 62 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15722116175512661
domContentLoaded15562103172312359
load15692119174712962
domInteractive2594432110
backgroundConnect97624199
firstReactRender16100412914
getState47317209
initialActions01000
loadScripts10811553125510550
setupStore87417209
uiStartup17642499202520397
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 192 Bytes (0.00%)
  • common: -2 Bytes (-0.00%)

@matteoscurati matteoscurati marked this pull request as ready for review January 27, 2025 15:43
@matteoscurati matteoscurati requested a review from a team as a code owner January 27, 2025 15:43
@metamaskbot
Copy link
Collaborator

Builds ready [d5efd0f]
Page Load Metrics (1724 ± 66 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint33220861592441212
domContentLoaded14672074169513967
load14982088172413866
domInteractive25143493316
backgroundConnect776362210
firstReactRender1699452813
getState57217178
initialActions01000
loadScripts10791596124412259
setupStore86017168
uiStartup178828891990239115
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 192 Bytes (0.00%)
  • common: -2 Bytes (-0.00%)

Copy link
Contributor

@darkwing darkwing left a comment

Choose a reason for hiding this comment

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

Good solution @matteoscurati ! We do need a slight change though:

We can't simply change the English key because the other languages don't get re-translated. What we'll need to do is:

  1. Create a new key in app/_locales/en/messages.json for the new string
  2. Run yarn verify-locales:fix to remove the old, unused strings from other languages.

That way the string will get properly translated by our vendors.

@matteoscurati
Copy link
Contributor Author

@darkwing thx! I’ve created the new strings with the latest commit!

@metamaskbot
Copy link
Collaborator

Builds ready [c1cd7ae]
Page Load Metrics (1479 ± 32 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1396161814826933
domContentLoaded1366158714596431
load1397162014796732
domInteractive156830147
backgroundConnect85324157
firstReactRender1493372713
getState49621
initialActions00000
loadScripts965114910515326
setupStore65412147
uiStartup15522018168410048
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 227 Bytes (0.00%)
  • common: 33 Bytes (0.00%)

@darkwing darkwing added this pull request to the merge queue Jan 30, 2025
Merged via the queue into main with commit 33ffbc5 Jan 30, 2025
70 checks passed
@darkwing darkwing deleted the fix/fix-insufficient-funds-displays-incorrect-native-token branch January 30, 2025 14:11
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2025
@metamaskbot metamaskbot added the release-12.12.0 Issue or pull request that will be included in release 12.12.0 label Jan 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.12.0 Issue or pull request that will be included in release 12.12.0 team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants