Skip to content

feat: When switching network alert the user and get approval if there are pending requests from origin. #30674

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 7 commits into from
Mar 13, 2025

Conversation

jpuri
Copy link
Contributor

@jpuri jpuri commented Mar 3, 2025

Description

When switching network alert the user and get approval if there are pending requests from origin.

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/4269
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/4327

Manual testing steps

  1. Enable EVM multichain locally using env variable EVM_MULTICHAIN_ENABLED
  2. Submit a confirmation
  3. Switch network - ensure a warning appears and pending confirmations are deleted as user confirms the warning

Screenshots/Recordings

Screenshot 2025-03-03 at 4 13 03 PM

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.

@jpuri jpuri added the team-confirmations Push issues to confirmations team label Mar 3, 2025
@jpuri jpuri requested a review from a team as a code owner March 3, 2025 10:43
Copy link
Contributor

github-actions bot commented Mar 3, 2025

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.

@jpuri jpuri requested a review from a team as a code owner March 4, 2025 13:46
@metamaskbot
Copy link
Collaborator

Builds ready [0505bc5]
Page Load Metrics (1612 ± 54 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint18118901477418201
domContentLoaded13721811157710752
load13811892161211254
domInteractive237539178
backgroundConnect1099372512
firstReactRender1473352211
getState45612147
initialActions01000
loadScripts972138511739747
setupStore7461194
uiStartup15662173183113465

@jpuri jpuri force-pushed the switch_network_approval branch 2 times, most recently from 5739a10 to a124990 Compare March 5, 2025 14:43
@@ -6,7 +6,7 @@ import { getMockPersonalSignConfirmState } from '../../../../../test/data/confir
import { renderHookWithProvider } from '../../../../../test/lib/render-helpers';
import * as AlertActions from '../../../../ducks/confirm-alerts/confirm-alerts';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These files are renamed as its used for all add/switch flows.

@jpuri jpuri force-pushed the switch_network_approval branch 3 times, most recently from d5840f8 to 97ef600 Compare March 5, 2025 15:07
@metamaskbot
Copy link
Collaborator

Builds ready [7351c5c]
Page Load Metrics (1715 ± 81 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint24320581627350168
domContentLoaded14312065168917082
load14442078171516881
domInteractive2084392010
backgroundConnect127928168
firstReactRender156731199
getState45214136
initialActions01000
loadScripts10671647125514871
setupStore761242110
uiStartup16502404195420498

@metamaskbot
Copy link
Collaborator

Builds ready [1aa7809]
Page Load Metrics (2269 ± 340 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29839871960933448
domContentLoaded143139502222688330
load147140202269708340
domInteractive26288966933
backgroundConnect7437539144
firstReactRender1574422311
getState568302211
initialActions01000
loadScripts107231061719562270
setupStore86220147
uiStartup161546242600822395

@jpuri jpuri force-pushed the switch_network_approval branch from 1aa7809 to d42103d Compare March 7, 2025 13:02
Base automatically changed from add_network_alert to main March 7, 2025 13:30
@jpuri jpuri dismissed OGPoyraz’s stale review March 7, 2025 13:30

The base branch was changed.

@metamaskbot
Copy link
Collaborator

Builds ready [d42103d]
Page Load Metrics (1632 ± 61 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14401923163313163
domContentLoaded14241874160713163
load14431907163212761
domInteractive228934178
backgroundConnect115425136
firstReactRender1473362411
getState55410115
initialActions01000
loadScripts10401456119912158
setupStore75817178
uiStartup16042187185515374

@jpuri jpuri force-pushed the switch_network_approval branch from d42103d to d2d7db9 Compare March 7, 2025 13:41
@jpuri jpuri requested a review from OGPoyraz March 7, 2025 13:41
OGPoyraz
OGPoyraz previously approved these changes Mar 7, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [70e4136]
Page Load Metrics (1903 ± 153 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint161226991888288138
domContentLoaded159722771822209100
load161128621903320153
domInteractive2510035168
backgroundConnect124777510852
firstReactRender1597462512
getState4212344923
initialActions00000
loadScripts11911727138516881
setupStore86516167
uiStartup182641662253559269
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 744 Bytes (0.01%)
  • ui: 109 Bytes (0.00%)
  • common: 247 Bytes (0.00%)

@jpuri jpuri requested a review from OGPoyraz March 7, 2025 17:00
@jpuri jpuri added this pull request to the merge queue Mar 13, 2025
Merged via the queue into main with commit aecb306 Mar 13, 2025
74 checks passed
@jpuri jpuri deleted the switch_network_approval branch March 13, 2025 11:16
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2025
@metamaskbot metamaskbot added the release-12.15.0 Issue or pull request that will be included in release 12.15.0 label Mar 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.15.0 Issue or pull request that will be included in release 12.15.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants