Skip to content

feat: Add origin throttling modal #29656

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 42 commits into from
Feb 12, 2025
Merged

Conversation

OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Jan 13, 2025

Description

This PR brings origin throttling modal functionality which is done in the mobile MetaMask/metamask-mobile#10082

The PR also needs an ApprovalController to be updated in order to subscribe the accepted and rejected approvals to handle user rejected approvals.

Core PR: MetaMask/core#5127

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3344
First mobile task: https://github.com/MetaMask/MetaMask-planning/issues/1822

Manual testing steps

  1. Go to test-dapp
  2. Trigger 2x sign/transaction and reject
  3. See modal appear on the third rejection
  4. Click "cancel" to ignore this modal and behaviour
  5. Trigger 2x sign/transaction and reject
  6. See modal appear on the third rejection
  7. Click "Temporarily block this site" and "Got It"
  8. Try sign/transaction - they will be blocked without error since they are considered & marked as "spam" by user
  9. Wait 1 minute to trigger or reset the situation

Screenshots/Recordings

origin.throttling.modal.mov

Before

After

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.

@OGPoyraz OGPoyraz requested a review from a team as a code owner January 13, 2025 12:09
@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Jan 13, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [68df0e0]
Page Load Metrics (1916 ± 104 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint41824571766495238
domContentLoaded150223851898214103
load150624301916218104
domInteractive2699462412
backgroundConnect56521199
firstReactRender16104522914
getState66322189
initialActions01000
loadScripts11131846143818991
setupStore66918199
uiStartup181428092244283136
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 2.47 KiB (0.04%)
  • ui: 6.37 KiB (0.08%)
  • common: 2.38 KiB (0.03%)

@metamaskbot
Copy link
Collaborator

Builds ready [6755df8]
Page Load Metrics (1582 ± 60 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint31818281505292140
domContentLoaded13711854156912459
load13761862158212460
domInteractive2110334199
backgroundConnect85220157
firstReactRender1596532613
getState45816199
initialActions01000
loadScripts959134211079847
setupStore75411105
uiStartup15702236185517785
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 2.79 KiB (0.05%)
  • ui: 6.18 KiB (0.08%)
  • common: 1.31 KiB (0.01%)

Prithpal-Sooriya and others added 3 commits February 12, 2025 09:20
## **Description**

Cherrypick of #28359
(afa7365)

This disables account syncing in v12.7.0

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28361?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

Co-authored-by: Mathieu Artu <[email protected]>
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
Copy link
Collaborator

Builds ready [c10559b]
Page Load Metrics (1731 ± 70 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15242047173114771
domContentLoaded15132009170814569
load15222041173114770
domInteractive25106432311
backgroundConnect96231209
firstReactRender16101403014
getState56314157
initialActions01000
loadScripts10231456124612158
setupStore787272411
uiStartup175625132021210101
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 2.78 KiB (0.05%)
  • ui: 6.42 KiB (0.08%)
  • common: 1.23 KiB (0.01%)

@OGPoyraz OGPoyraz added this pull request to the merge queue Feb 12, 2025
Merged via the queue into main with commit e5a8ff9 Feb 12, 2025
73 checks passed
@OGPoyraz OGPoyraz deleted the 3344-add-spam-prevention-on-extension branch February 12, 2025 15:28
@github-actions github-actions bot locked and limited conversation to collaborators Feb 12, 2025
@metamaskbot metamaskbot added the release-12.13.0 Issue or pull request that will be included in release 12.13.0 label Feb 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.13.0 Issue or pull request that will be included in release 12.13.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants