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 switch network popup #25299

Merged
merged 8 commits into from
Jun 14, 2024
Merged

fix: Fix switch network popup #25299

merged 8 commits into from
Jun 14, 2024

Conversation

NidhiKJha
Copy link
Member

This PR is to ensure the network switch modal doesn't show up in a flash when network is switched via the dapp

Related issues

Fixes: #25196

Manual testing steps

  1. Go to Pancake swap Dapp
  2. Connect MetaMask
  3. Switch to Polygon or any network that is not already added to network list in metamask via Dapp
  4. Network switch should happen and no modal should up in the flash

Screenshots/Recordings

Before

338417177-79e9c5a7-ba32-4a82-b919-8c65fc27e16f.mov

After

Screen.Recording.2024-06-13.at.2.14.52.PM.mov

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.

@NidhiKJha NidhiKJha requested a review from a team as a code owner June 13, 2024 15:03
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 INVALID-PR-TEMPLATE PR's body doesn't match template label Jun 13, 2024
@NidhiKJha NidhiKJha added team-wallet-ux needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. labels Jun 13, 2024
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.

Approving but we should look into why putting this into shouldShowNetworkInfo is problematic. Thank you Nidhi!

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 65.63%. Comparing base (0fd5f5e) to head (ab1a7b4).
Report is 11 commits behind head on develop.

Files Patch % Lines
ui/pages/routes/routes.component.js 66.67% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25299      +/-   ##
===========================================
- Coverage    65.63%   65.63%   -0.00%     
===========================================
  Files         1375     1375              
  Lines        54553    54555       +2     
  Branches     14294    14296       +2     
===========================================
+ Hits         35803    35804       +1     
- Misses       18750    18751       +1     

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

@metamaskbot
Copy link
Collaborator

Builds ready [ab1a7b4]
Page Load Metrics (63 ± 8 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint81195992311
domContentLoaded105916115
load4912963168
domInteractive105916115
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 34 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@bergeron bergeron left a comment

Choose a reason for hiding this comment

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

Looks good to me. I verified the behavior before and after. And I do get the popup when eventually opening MM

@sleepytanya
Copy link
Contributor

sleepytanya commented Jun 14, 2024

Build from current branch, orangefox test account.

What I think might be happening with the network notifications. On the home screen we show notification 'You are now using ***' and user doesn't close it because in order to see this notification user must click on the MM icon or switch to MM tab. When user switches network while having this notification on the home screen then the bug might happen.
The bug is hard to reproduce because the logic to show the notification on the home screen is not strait forward and seems to be related to a number of things.

  1. It doesn't look related to the assets on the selected network (e.g. we show notification for the Polygon zkEVM with 0 assets and we don't show notification for the Fuse which also has 0 assets
notif.mov
  1. It looks related to the fact if network has been already added / used. The behavior also changes if user tries to add the same network that has been added previously using another dapp.
btChain.mov

Sometimes the logic for showing notification seems absolutely random.

I also observed that sometimes we show notification for such a short time that it is hard to notice but it is still there.

fast.mov

Notification is shown briefly on the home screen:

homeNotif.mov

Notification shown when I connect to sushiswaps and the second notification when switching from Moonbeam to Blast:

sushiBlast.mov

@NidhiKJha NidhiKJha merged commit 6163319 into develop Jun 14, 2024
82 of 83 checks passed
@NidhiKJha NidhiKJha deleted the fix-switch-network-popup branch June 14, 2024 13:23
@github-actions github-actions bot locked and limited conversation to collaborators Jun 14, 2024
@metamaskbot metamaskbot added release-12.1.0 Issue or pull request that will be included in release 12.1.0 release-12.0.0 Issue or pull request that will be included in release 12.0.0 and removed release-12.1.0 Issue or pull request that will be included in release 12.1.0 labels Jun 14, 2024
@metamaskbot
Copy link
Collaborator

Missing release label release-12.0.0 on PR. Adding release label release-12.0.0 on PR and removing other release labels(release-12.1.0), as PR was cherry-picked in branch 12.0.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template 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-wallet-ux
Projects
None yet
7 participants