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: allow getAddTransactionRequest to pass through other params #27117

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

martahj
Copy link
Contributor

@martahj martahj commented Sep 12, 2024

Description

Updates getAddTransactionRequest to pass through additional parameters so that waitForSubmit will get passed through to addTransaction .

Previously, the waitForSubmit param, although passed by addTransaction and addTransactionAndWaitForPublish, was not included in the object returned by getAddTransactionRequest. This doesn't seem to have had negative consequences on a standard wallet, but when using a hardware wallet, it meant that addTransactionAndWaitForPublish resolved before waiting for the user to accept or reject the transaction. As a consequence, when doing a swap, the user was taken directly to the "Processing..." screen before they had a chance to take action on the transaction. If they rejected the transaction, they remained on that screen indefinitely.

Open in GitHub Codespaces

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMS-1189

Manual testing steps

  1. Disable smart transactions
  2. Confirm that the following flows work and display relevant and expected screens using both a hardware and standard wallet:
  • Swap that does not need approval step - accept tx
  • Swap that does not need approval step - reject tx
  • Swap that needs approval step - reject approval tx
  • Swap that needs approval step - accept approval tx, reject trade tx
  • Swap that needs approval step - accept both txs
  • Send + swap that does not need approval step - accept tx
  • Send + swap that does not need approval step - reject tx
  • Send + swap that needs approval step - reject approval tx
  • Send + swap that needs approval step - accept approval tx, reject trade tx
  • Send + swap that needs approval step - accept both txs

Screenshots/Recordings

Before

Video from bug report (shows rejecting swap flow):

noSTX.mov

After

Accepting swap:

IMG_8102.MOV

Rejecting swap:

IMG_8103.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.

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.

Copy link

sonarcloud bot commented Sep 13, 2024

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.05%. Comparing base (fb72eca) to head (09bab84).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #27117      +/-   ##
===========================================
+ Coverage    70.04%   70.05%   +0.01%     
===========================================
  Files         1435     1435              
  Lines        49927    49927              
  Branches     13981    13981              
===========================================
+ Hits         34971    34975       +4     
+ Misses       14956    14952       -4     

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

@metamaskbot
Copy link
Collaborator

Builds ready [09bab84]
Page Load Metrics (1972 ± 106 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint22823491872434208
domContentLoaded151523281954229110
load155223441972221106
domInteractive1493402211
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 10 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@martahj martahj marked this pull request as ready for review September 13, 2024 14:59
@martahj martahj requested a review from a team as a code owner September 13, 2024 14:59
davibroc
davibroc previously approved these changes Sep 20, 2024
Copy link
Contributor

@davibroc davibroc left a comment

Choose a reason for hiding this comment

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

I have tested the fix and it works well now @martahj @dan437

dan437
dan437 previously approved these changes Sep 24, 2024
Copy link
Contributor

@dan437 dan437 left a comment

Choose a reason for hiding this comment

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

LGTM

dbrans
dbrans previously approved these changes Oct 7, 2024
@martahj martahj dismissed stale reviews from dbrans and dan437 via 455abaa October 7, 2024 18:09
Co-authored-by: Derek Brans <dbrans@gmail.com>
@metamaskbot
Copy link
Collaborator

Builds ready [3f1749d]
Page Load Metrics (1798 ± 80 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15912206180216177
domContentLoaded15842198177515273
load15922208179816780
domInteractive26164483115
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 10 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

sonarcloud bot commented Oct 8, 2024

@martahj martahj added this pull request to the merge queue Oct 8, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [23f116c]
Page Load Metrics (1979 ± 99 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint39622671725522250
domContentLoaded17202501193719393
load17282507197920699
domInteractive16254745828
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 10 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Merged via the queue into develop with commit f41a625 Oct 8, 2024
78 checks passed
@martahj martahj deleted the swapping-hardware-wallet-bug branch October 8, 2024 19:51
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2024
@metamaskbot metamaskbot added the release-12.7.0 Issue or pull request that will be included in release 12.7.0 label Oct 8, 2024
@gauthierpetetin gauthierpetetin added release-12.6.0 Issue or pull request that will be included in release 12.6.0 and removed release-12.7.0 Issue or pull request that will be included in release 12.7.0 labels Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.6.0 Issue or pull request that will be included in release 12.6.0 team-extension-platform team-swaps
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants