Skip to content

fix: replicate network change actions in rpc modal #29943

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 1 commit into from
Jan 29, 2025

Conversation

bergarces
Copy link
Contributor

@bergarces bergarces commented Jan 28, 2025

Description

The issue occurred because switching networks from the RPC selector, which is only available when there's a network with at least 2 RPCs, was not performing the same actions as switching networks from clicking the network list item directly.

I have created a handler for the actions that need to be performed and passed it down to both the network list item and the rpc selector modal, that way it ensures that the same actions occur.

A test has been added to the rpc modal to validate the new handler is being called. Tests already exist in the network list to validate that those actions are taking place, and they are still passing.

Open in GitHub Codespaces

Related issues

Fixes: #29260

Manual testing steps

  1. Ensure at least one of your networks has more than one RPC, so that the RPC selector appears.
  2. Set any network and, in the Tokens tab, select "Current network" as the option.
  3. Open the network selector and select another network by clicking in the rpc url, which will open an rpc selector modal.
  4. Select any of the RPCs and check that the tokens from the new network appear and that "Current network" is still

Screenshots/Recordings

Before

bug.mp4

After

fixed.mp4

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 metamaskbot added the team-mmi PRs from the MMI team label Jan 28, 2025
@bergarces bergarces force-pushed the fix/29260-network-switch-token-list-update branch 4 times, most recently from 3ce7e3a to 440f95d Compare January 28, 2025 16:12
@bergarces bergarces force-pushed the fix/29260-network-switch-token-list-update branch from 440f95d to 7f66605 Compare January 28, 2025 16:12
@metamaskbot
Copy link
Collaborator

Builds ready [7f66605]
Page Load Metrics (1953 ± 80 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17342283195015876
domContentLoaded16752272191615675
load17002281195316680
domInteractive289647189
backgroundConnect14102422613
firstReactRender18101532814
getState85820168
initialActions00000
loadScripts12471715141613063
setupStore996242412
uiStartup199028972299253122
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: -2 Bytes (-0.00%)
  • common: 0 Bytes (0.00%)

@bergarces bergarces added team-assets and removed team-mmi PRs from the MMI team labels Jan 28, 2025
@bergarces bergarces marked this pull request as ready for review January 28, 2025 17:00
@bergarces bergarces requested a review from a team as a code owner January 28, 2025 17:00
Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@NidhiKJha NidhiKJha left a comment

Choose a reason for hiding this comment

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

LGTM

@bergarces bergarces added this pull request to the merge queue Jan 29, 2025
Merged via the queue into main with commit 89f8021 Jan 29, 2025
81 checks passed
@bergarces bergarces deleted the fix/29260-network-switch-token-list-update branch January 29, 2025 14:25
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2025
@metamaskbot metamaskbot added the release-12.12.0 Issue or pull request that will be included in release 12.12.0 label Jan 29, 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
Archived in project
Development

Successfully merging this pull request may close these issues.

[Bug]: Following a network switch, the token list does not update accordingly
4 participants