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

feat: prevent pasting of Snap name during Snap removal #23993

Merged
merged 5 commits into from
Apr 17, 2024

Conversation

montelaidev
Copy link
Contributor

Description

The confirmation to remove a snap that has accounts present in the keyring, requires that the user type the snap name to confirm removal. However, the user can just copy and paste the name of the snap being removed. This PR disables the ability to paste the name.

Related issues

Fixes: 21445

Manual testing steps

  1. Create a new snap account
  2. Go to settings and click on snap
  3. Click on the snap and then remove snap
  4. Click continue on the modal
  5. Try to copy and paste the snap name in the input.
  6. See that the input remains empty.

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). 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.

@montelaidev montelaidev requested a review from a team as a code owner April 12, 2024 12:39
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 [14c3765]
Page Load Metrics (1445 ± 672 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint593191437234
domContentLoaded99527199
load46386514451400672
domInteractive99527199
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 32 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

codecov bot commented Apr 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.52%. Comparing base (f8b92ab) to head (e6def94).
Report is 19 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #23993   +/-   ##
========================================
  Coverage    67.52%   67.52%           
========================================
  Files         1244     1244           
  Lines        48807    48807           
  Branches     12747    12747           
========================================
  Hits         32955    32955           
  Misses       15852    15852           

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

@danroc danroc changed the title Feat: prevent pasting of snap name during snap removal feat: prevent pasting of Snap name during snap removal Apr 17, 2024
@danroc danroc changed the title feat: prevent pasting of Snap name during snap removal feat: prevent pasting of Snap name during Snap removal Apr 17, 2024
…nap-removal-warning.test.tsx

Co-authored-by: Daniel Rocha <daniel.rocha@consensys.net>
@metamaskbot
Copy link
Collaborator

Builds ready [e6def94]
Page Load Metrics (1364 ± 683 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint753681508239
domContentLoaded97128168
load58358513641422683
domInteractive97128168
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 32 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@montelaidev montelaidev merged commit f0494a1 into develop Apr 17, 2024
67 of 68 checks passed
@montelaidev montelaidev deleted the fix/21445/disable-copy-paste-of-snap-name branch April 17, 2024 08:59
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 2024
@metamaskbot metamaskbot added the release-11.16.0 Issue or pull request that will be included in release 11.16.0 label Apr 17, 2024
@k-g-j
Copy link
Contributor

k-g-j commented Apr 29, 2024

Chrome Version 124.0.6367.93 manual testing steps worked as expected, and the user cannot copy and paste the snap name via the keyboard shortcut or edit menu ✅

chrome-pr-23993-test.mov

Firefox Version 125.0.3 manual testing steps worked as expected, and the user cannot copy and paste the snap name via the keyboard shortcut or edit menu ✅

firefox-pr-23993-test.mov

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.16.0 Issue or pull request that will be included in release 11.16.0 team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Remove account snap allows copy/paste of snap name
5 participants