Skip to content

addEthereumChain bug fixes#10520

Merged
brad-decker merged 4 commits intodevelopfrom
add-ethereum-chain-fixes
Feb 25, 2021
Merged

addEthereumChain bug fixes#10520
brad-decker merged 4 commits intodevelopfrom
add-ethereum-chain-fixes

Conversation

@brad-decker
Copy link
Copy Markdown
Contributor

Fixes: QA issues four with wallet_addEthereumChain

  1. Stringifies the params object when throwing an error.
  2. removes a double word typo in the messages file
  3. Closes the confirmation window directly instead of dispatching the corresponding action. This addresses an edge case where a user might have a switch network confirmation open while another transaction is queued up by the dapp or another dapp. The switch network confirmation clears all pending confirmations, but the closeNotificationWindow action is still seeing a pending confirmation when checking if it should close.

The alternative solution to the third bullet is to wait for promisifedBackground.getState instead of using redux's getState... but not sure what kind of impact that'll have on all the other confirmations.

@brad-decker brad-decker marked this pull request as ready for review February 25, 2021 16:45
@brad-decker brad-decker requested a review from a team as a code owner February 25, 2021 16:45
@brad-decker brad-decker requested a review from Gudahtt February 25, 2021 16:45
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [f987e26]
Page Load Metrics (605 ± 56 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint478762105
domContentLoaded35188060311656
load35388160511656
domInteractive35188060311656

@brad-decker brad-decker force-pushed the add-ethereum-chain-fixes branch 2 times, most recently from b06b0ea to c96db31 Compare February 25, 2021 17:32
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [c96db31]
Page Load Metrics (648 ± 40 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint50726273
domContentLoaded5478356478340
load5488366488240
domInteractive5468346468240

@brad-decker brad-decker requested a review from Gudahtt February 25, 2021 19:01
@brad-decker brad-decker changed the title remove double word typo addEthereumChain bug fixes Feb 25, 2021
useEffect(() => {
const environmentType = getEnvironmentType();
// If the number of pending confirmations reduces to zero when the user
// is in the fullscreen or popup UI, return them to the default route.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: This comment should probably be updated since this now applies to the notification UI as well

const { pendingApprovals } = await forceUpdateMetamaskState(dispatch);
if (Object.values(pendingApprovals).length === 0) {
dispatch(closeCurrentNotificationWindow());
dispatch(closeNotificationWindow());
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt Feb 25, 2021

Choose a reason for hiding this comment

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

What does this function do 🤔

Edit: To expand on this (sorry I was in a meeting when I wrote this 😅 ), it looks like this is dead code. It dispatches an action that doesn't do anything.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

haha when i read it i was like "doh i used the wrong function" -- i added a commit to remove the dead code.

@brad-decker brad-decker force-pushed the add-ethereum-chain-fixes branch from c96db31 to 5b3341f Compare February 25, 2021 21:23
@brad-decker brad-decker requested a review from Gudahtt February 25, 2021 21:40
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [012c720]
Page Load Metrics (674 ± 38 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint50746273
domContentLoaded4588156727838
load4598166747838
domInteractive4578156727838

Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@brad-decker brad-decker merged commit 1a2dc85 into develop Feb 25, 2021
@brad-decker brad-decker deleted the add-ethereum-chain-fixes branch February 25, 2021 22:25
@github-actions github-actions bot locked and limited conversation to collaborators Feb 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants