Skip to content

fix: erc20 import error#24620

Merged
sahar-fehri merged 4 commits intodevelopfrom
fix/fix-erc20-import-bug
May 27, 2024
Merged

fix: erc20 import error#24620
sahar-fehri merged 4 commits intodevelopfrom
fix/fix-erc20-import-bug

Conversation

@sahar-fehri
Copy link
Copy Markdown
Contributor

@sahar-fehri sahar-fehri commented May 20, 2024

Description

When you try to import an ERC20, it will require clicking on the next button twice before moving to the confirmation modal.
You will also see this error in the console:

SES_UNHANDLED_REJECTION: Error: Invariant failed: A state mutation was detected between dispatches, in the path 'metamask.tokenList.0x0000000000300dd8b0230efcfef136ecdf6abcde.unlisted'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state) (see video)

I used spread operator to update the "unlisted" value in tokens instead of changing its value directly.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to home age
  2. Click on import tokens and select any token from the list
  3. Click on "Next" button. Make sure you have only clicked the button once and you were moved successfully to confirmation page.
  4. The error should not appear in console.

Screenshots/Recordings

Before

Screen.Recording.2024-05-20.at.14.00.53.mov

After

Screen.Recording.2024-05-20.at.14.06.11.mov

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • 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 format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). 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 sahar-fehri requested a review from a team as a code owner May 20, 2024 12:22
@github-actions
Copy link
Copy Markdown
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.

@sahar-fehri sahar-fehri added needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. team-assets labels May 20, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented May 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 67.37%. Comparing base (d8fd077) to head (250d7a9).

Current head 250d7a9 differs from pull request most recent head c811dff

Please upload reports for the commit c811dff to get more accurate results.

Files Patch % Lines
ui/store/actions.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #24620      +/-   ##
===========================================
- Coverage    67.40%   67.37%   -0.02%     
===========================================
  Files         1289     1289              
  Lines        50248    50221      -27     
  Branches     13011    13005       -6     
===========================================
- Hits         33865    33835      -30     
- Misses       16383    16386       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [250d7a9]
Page Load Metrics (294 ± 326 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6811786136
domContentLoaded9301463
load542477294679326
domInteractive9301463
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 20 Bytes (0.00%)

@DDDDDanica
Copy link
Copy Markdown
Contributor

LGTM ! Smooth fix !

@hjetpoluru hjetpoluru self-requested a review May 21, 2024 14:05
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [c811dff]
Page Load Metrics (944 ± 519 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint57157952411
domContentLoaded94317115
load4725649441081519
domInteractive84317115
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 20 Bytes (0.00%)

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [c25104e]
Page Load Metrics (1241 ± 564 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint621501042914
domContentLoaded97023189
load50251912411174564
domInteractive97023189
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 20 Bytes (0.00%)

@sahar-fehri sahar-fehri merged commit 31fc52f into develop May 27, 2024
@sahar-fehri sahar-fehri deleted the fix/fix-erc20-import-bug branch May 27, 2024 14:19
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2024
@gauthierpetetin gauthierpetetin added the release-12.0.0 Issue or pull request that will be included in release 12.0.0 label Jun 6, 2024
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.0.0 Issue or pull request that will be included in release 12.0.0 team-assets

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants