-
Notifications
You must be signed in to change notification settings - Fork 5k
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 incorrect warnings when adding a chain from a dapp #22309
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
pedronfigueiredo
previously approved these changes
Dec 18, 2023
…r attempting to fetch chain validation data
pedronfigueiredo
force-pushed
the
fix-add-chain-warnings
branch
from
December 18, 2023 10:55
06ef638
to
9df0c45
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #22309 +/- ##
===========================================
- Coverage 67.94% 67.90% -0.04%
===========================================
Files 1067 1067
Lines 41290 41296 +6
Branches 11087 11090 +3
===========================================
- Hits 28054 28041 -13
- Misses 13236 13255 +19 ☔ View full report in Codecov by Sentry. |
pedronfigueiredo
approved these changes
Dec 18, 2023
Builds ready [9df0c45]
Page Load Metrics (1259 ± 141 ms)
Bundle size diffs
|
DDDDDanica
added
team-extension-client
team-extension-platform
and removed
INVALID-PR-TEMPLATE
PR's body doesn't match template
labels
Dec 18, 2023
DDDDDanica
approved these changes
Dec 18, 2023
metamaskbot
added
the
release-11.9.0
Issue or pull request that will be included in release 11.9.0
label
Dec 18, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
release-11.9.0
Issue or pull request that will be included in release 11.9.0
team-extension-platform
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When a user adds a chain from a dapp, they will see warnings that the currency symbol is incorrect, even though it is correct.
Part of the problem was that the
pendingConfirmation
variable inside offetchSafeChainsList
was undefined when it should not be. I guess it closed over the original value or something like that? I didn't verify. This PR corrects it by explictly passing the updatedpendingConfirmations
variable tofetchSafeChainList
The other problem was that
useAlertState
was callinggetTemplateAlerts
twice, without resetting the alert state. On the first call, alerts were being set in state because the request to chainId.network had not yet resolved. This PR fixes it by ensuring that thatuseAlertState
does not callgetTemplateAlerts
before the fetch to chainId.network has resolved (when this confrimation type is an add ethereum chain approval)Related issues
An example of the problem can be seen by going to https://chainlist.org/?search=cro and adding Cronos Mainnet to metamask, only to see warnings that the currency symbol is incorrect even though it is correct.
Manual testing steps
"symbol": "cra",
becomes"symbol": "cro",
, paste it in the dev console and press enter. There should be no warnings in the new confirmation windowBefore
cronos-fail.mp4
After
cronos-pass.mp4
Pre-merge author checklist
Pre-merge reviewer checklist