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 (cherry-pick): UX: Multichain: Add safeguard to throw error when confirmation chainId doesn't match current chainId (#25634) #25664

Merged

Conversation

darkwing
Copy link
Contributor

@darkwing darkwing commented Jul 3, 2024

Description

This PR adds a safety rail to the confirmation screen such that an error is thrown if the user is seeing a confirmation for a transaction triggered on another chain.

Open in GitHub Codespaces

Related issues

Related: #25596

Manual testing steps

  1. This state should be impossible to get to via the UI, thus no reasonable manual testing steps. Unit test included.

Screenshots/Recordings

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.

Description

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

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.

…hainId doesn't match current chainId (#25634)

## **Description**

This PR adds a safety rail to the confirmation screen such that an error
is thrown if the user is seeing a confirmation for a transaction
triggered on another chain.

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

## **Related issues**

Related:  #25596

## **Manual testing steps**

1. This state should be impossible to get to via the UI, thus no
reasonable manual testing steps. Unit test included.

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

- [ ] 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).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] 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.
@darkwing darkwing requested a review from a team as a code owner July 3, 2024 17:57
@darkwing darkwing changed the title fix: UX: Multichain: Add safeguard to throw error when confirmation chainId doesn't match current chainId (#25634) fix (cherry-pick): UX: Multichain: Add safeguard to throw error when confirmation chainId doesn't match current chainId (#25634) Jul 3, 2024
Copy link
Contributor

github-actions bot commented Jul 3, 2024

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.

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 65.62%. Comparing base (6985713) to head (f655bd3).

Files Patch % Lines
...saction-base/confirm-transaction-base.component.js 50.00% 3 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           Version-v12.0.0   #25664   +/-   ##
================================================
  Coverage            65.62%   65.62%           
================================================
  Files                 1363     1363           
  Lines                54328    54330    +2     
  Branches             14122    14123    +1     
================================================
+ Hits                 35649    35651    +2     
  Misses               18679    18679           

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

@metamaskbot
Copy link
Collaborator

Builds ready [f655bd3]
Page Load Metrics (48 ± 4 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint661017994
domContentLoaded9181021
load41724884
domInteractive9181021
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 70.27 KiB (2.03%)
  • ui: 10.32 KiB (0.15%)
  • common: 171.28 KiB (2.72%)

@darkwing
Copy link
Contributor Author

darkwing commented Jul 3, 2024

@metamaskbot update-attributions

## **Description**

This fixes a crash of the transaction screen caused by the swap and
smart transaction feature flag being incorrectly set.

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

## **Related issues**

Fixes:

## **Manual testing steps**

1. Try sending a transaction with smart transaction enabled

## **Screenshots/Recordings**

### **Before**


![image](https://github.com/MetaMask/metamask-extension/assets/13910212/d4e97a34-d6a0-4c0a-98f8-6fff5f54e095)


### **After**


![image](https://github.com/MetaMask/metamask-extension/assets/13910212/af52dd4a-b039-4671-b25c-88fb6751a330)

## **Pre-merge author checklist**

- [ ] 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).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] 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.
@darkwing darkwing force-pushed the Version-v12.0.0.0-cherrypick-confirmation-safety branch from 4606af8 to 24c20a5 Compare July 9, 2024 17:13
@danjm danjm merged commit b07f836 into Version-v12.0.0 Jul 9, 2024
72 of 75 checks passed
@danjm danjm deleted the Version-v12.0.0.0-cherrypick-confirmation-safety branch July 9, 2024 18:28
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2024
@metamaskbot metamaskbot added the release-12.0.0 Issue or pull request that will be included in release 12.0.0 label Jul 9, 2024
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-12.0.0 on PR, 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
release-12.0.0 Issue or pull request that will be included in release 12.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants