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

Added navigation between multiple sign prompts and reject all sign prompts #17093

Merged
merged 13 commits into from
Jan 31, 2023

Conversation

VSaric
Copy link
Contributor

@VSaric VSaric commented Jan 6, 2023

Explanation

With this fix, the users should be able to navigate between multiple sign prompts back and forth and should be able to reject all sign prompts at once for Eth Sign, Personal Sign, SignTypedData, SignTypedData_v3 and SignTypedData_v4. Also we are using a single component for navigation which will show both messages and transactions requests.

Screenshots/Screencaps

Before

206234177-845cbb7e-8454-47c6-bcbd-4daedb292ebd.mp4

After

popup view

Screen.Recording.2023-01-06.at.13.58.27.mov

expanded view

Screen.Recording.2023-01-06.at.13.30.06.mov

Using a single component for navigation which will show both messages and transactions requests and visa versa

Screen.Recording.2023-01-25.at.12.29.57.mov

Manual Testing Steps

  1. Connect to Test Dapp https://metamask.github.io/test-dapp/
  2. Click multiple times on Eth Sign or Personal Sign or SignTypedData or SignTypedData_v3or SignTypedData_v4.
  3. The users should be able to navigate between multiple sign prompts back and forth and should be able to reject all sign prompts at once

Using a single component for navigation which will show both messages and transactions requests and visa versa

  1. Connect to Test Dapp https://metamask.github.io/test-dapp/
  2. Click multiple times on Piggy bank contract section (Deploy Contract) or Send Tokens section (Create Token) or Send Eth section (Send Legacy Transaction or Send EIP 1559 Transaction) and than click multiple times on Eth Sign or Personal Sign or SignTypedData or SignTypedData_v3or SignTypedData_v4.
  3. The users should be able to navigate between multiple sign prompts and transactions back and forth

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

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.

@VSaric VSaric self-assigned this Jan 6, 2023
@metamaskbot
Copy link
Collaborator

Builds ready [c403d4e]
Page Load Metrics (1639 ± 164 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1021405195278134
domContentLoaded115627481615343165
load115627481639342164
domInteractive115627481615343165
Bundle size diffs
  • background: 0 bytes
  • ui: 3294 bytes
  • common: 0 bytes

highlights:

storybook

@VSaric VSaric changed the base branch from develop to fix/navigate-through-multiple-unapproved-approved-transactions January 6, 2023 13:24
@filipsekulic filipsekulic force-pushed the fix/navigate-through-multiple-unapproved-approved-transactions branch from 094315d to 8220055 Compare January 9, 2023 09:09
@VSaric VSaric changed the base branch from fix/navigate-through-multiple-unapproved-approved-transactions to develop January 9, 2023 09:12
@VSaric VSaric changed the base branch from develop to fix/navigate-through-multiple-unapproved-approved-transactions January 9, 2023 09:34
@VSaric VSaric changed the base branch from fix/navigate-through-multiple-unapproved-approved-transactions to develop January 9, 2023 09:35
@VSaric VSaric force-pushed the navigation-and-reject-all-signature-requests branch from c403d4e to cb3cf68 Compare January 9, 2023 09:47
@metamaskbot
Copy link
Collaborator

Builds ready [cb3cf68]
Page Load Metrics (1540 ± 131 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint111170133168
domContentLoaded117421201530265127
load117421701540272131
domInteractive117421201530265127
Bundle size diffs
  • background: 0 bytes
  • ui: 3266 bytes
  • common: 0 bytes

highlights:

storybook

@dzfjz
Copy link
Contributor

dzfjz commented Jan 9, 2023

Verified by QA

@VSaric VSaric marked this pull request as ready for review January 9, 2023 12:25
@VSaric VSaric requested a review from a team as a code owner January 9, 2023 12:25
@VSaric VSaric requested review from PeterYinusa and danjm January 9, 2023 12:25
@metamaskbot
Copy link
Collaborator

Builds ready [80c11c3]
Page Load Metrics (1260 ± 76 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint892931164321
domContentLoaded10211656125115072
load10391729126015776
domInteractive10211656125115072
Bundle size diffs
  • background: 0 bytes
  • ui: 3266 bytes
  • common: 0 bytes

highlights:

storybook

@VSaric VSaric force-pushed the navigation-and-reject-all-signature-requests branch from 80c11c3 to 53df20e Compare January 11, 2023 15:54
@metamaskbot
Copy link
Collaborator

Builds ready [53df20e]
Page Load Metrics (1521 ± 113 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint102177140188
domContentLoaded124421051502239115
load126421051521236113
domInteractive124421051502239115
Bundle size diffs
  • background: 0 bytes
  • ui: 2522 bytes
  • common: 0 bytes

highlights:

storybook

@VSaric VSaric requested a review from brad-decker January 12, 2023 14:47
@VSaric VSaric force-pushed the navigation-and-reject-all-signature-requests branch from 53df20e to 2c924a0 Compare January 12, 2023 16:21
@VSaric VSaric requested a review from jpuri January 13, 2023 14:50
@metamaskbot
Copy link
Collaborator

Builds ready [fa3cda9]
Page Load Metrics (1214 ± 90 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint87126104115
domContentLoaded10741740119715976
load10741850121418690
domInteractive10741740119715976
Bundle size diffs
  • background: 0 bytes
  • ui: 2522 bytes
  • common: 0 bytes

highlights:

storybook

@VSaric VSaric force-pushed the navigation-and-reject-all-signature-requests branch from fa3cda9 to 81fe32b Compare January 16, 2023 09:30
@metamaskbot
Copy link
Collaborator

Builds ready [81fe32b]
Page Load Metrics (1179 ± 52 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint91131108126
domContentLoaded10201507117610953
load10391507117910952
domInteractive10201507117610953
Bundle size diffs
  • background: 0 bytes
  • ui: 2522 bytes
  • common: 0 bytes

highlights:

storybook

Copy link
Contributor

@jpuri jpuri left a comment

Choose a reason for hiding this comment

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

Changes in confirm-page-container-navigation.component.js can cause unapproved signature request to be opened from transaction page and visa versa.

An option could be creating separate component for signatures. This new component and confirm-page-container-navigation.component.js can be refactored to use same dumb component for UI rendering.

@seaona
Copy link
Contributor

seaona commented Jan 19, 2023

Some behaviour to double-check related to mixing Signatures with Sends/Deploys tx's following up @jpuri comment: after prompting for a couple of signatures without accepting them, if the Dapp now sends Send/Deploy tx's requests, MM starts to behave strangely. Issues:

  • after some pending Signatures, you try a couple of Sends, and the top navigation displays now the number of pending Sends, but with the Signatures screens. Imagine you had 3 pending Signatures and 2 pending Sends: you'll see navigation for the Sends (2), but the screen for Signatures
  • if you then navigate to the Next page, you are now seeing the pending Sends with their navigation and the Signatures won't appears anymore until you reject/accept the pending Sends.
sign-reqs-tx-reqs.mp4

I am not sure what should be the expect behaviour though:

  • are we aiming to consider all Dapp API calls into one navigation flow? I think that would be good for the usability, but not sure how complex might be to implement, depending on how the code is at the moment
  • if we want to separate the different Dapp requests, we should fix the navigation mix and the clicking Next, making switch from pending Signatures to pending Sends

@VSaric VSaric force-pushed the navigation-and-reject-all-signature-requests branch from 81fe32b to d929dde Compare January 19, 2023 15:11
@VSaric
Copy link
Contributor Author

VSaric commented Jan 19, 2023

Changes in confirm-page-container-navigation.component.js can cause unapproved signature request to be opened from transaction page and visa versa.

An option could be creating separate component for signatures. This new component and confirm-page-container-navigation.component.js can be refactored to use same dumb component for UI rendering.

You are right @jpuri! I created separate component for signatures and this new component for signatures and confirm-page-container-navigation.component.js are refactored now. This two components are using same component for UI rendering (in this case navigation.js).
I will appreciate your re-review on this and if there is some new suggestions please comment and I will address them. You can check latest changes here.

@VSaric
Copy link
Contributor Author

VSaric commented Jan 25, 2023

Hey @VSaric : me and @bschorchit had chat about this and we decided that this approach will be better:

are we aiming to consider all Dapp API calls into one navigation flow? I think that would be good for the usability, but not sure how complex might be to implement, depending on how the code is at the moment

It seems that this will increase your effort in the task and you almost need to re-do it. Can you plz check this.

We are aiming to have a single component for navigation which will show both messages and transactions and any other DAPP request.

@jpuri @bschorchit @seaona I added a single component for navigation which will show both messages and transactions requests. Here are those changes. You can also check in the PR description, I attached screencast with latest changes. I will appreciate your re-review on this. Thanks!

@jpuri
Copy link
Contributor

jpuri commented Jan 25, 2023

Hey @VSaric : code changes look great. Will be n ice to have some more test coverage also.

@dzfjz
Copy link
Contributor

dzfjz commented Jan 26, 2023

Verified by QA

@VSaric VSaric force-pushed the navigation-and-reject-all-signature-requests branch from 6fa54d2 to 8bc9ed8 Compare January 30, 2023 10:03
@VSaric
Copy link
Contributor Author

VSaric commented Jan 30, 2023

Hey @VSaric : code changes look great. Will be n ice to have some more test coverage also.

Hey @jpuri, I added more unit tests.

@metamaskbot
Copy link
Collaborator

Builds ready [621269d]
Page Load Metrics (1193 ± 94 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint93151115136
domContentLoaded9901578117619594
load10041579119319594
domInteractive9901578117619594
Bundle size diffs
  • background: 0 bytes
  • ui: 2385 bytes
  • common: 0 bytes

history.push(
uncofirmedTransactions[txId]?.msgParams
? `${CONFIRM_TRANSACTION_ROUTE}/${txId}${SIGNATURE_REQUEST_PATH}`
: `${CONFIRM_TRANSACTION_ROUTE}/${txId}`,
Copy link
Contributor

@jpuri jpuri Jan 31, 2023

Choose a reason for hiding this comment

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

I think if you route all request to ${CONFIRM_TRANSACTION_ROUTE}/${txId} it takes care to re-route to specific page depending on request type and should work for any confirmation request in fact, but above also looks good 👍

Copy link
Contributor

@jpuri jpuri left a comment

Choose a reason for hiding this comment

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

Great work 👍

@metamaskbot
Copy link
Collaborator

Builds ready [ba47ee3]
Page Load Metrics (1564 ± 158 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint92177140199
domContentLoaded99421571526331159
load106521831564328158
domInteractive99421571526331159
Bundle size diffs
  • background: 0 bytes
  • ui: 2385 bytes
  • common: 0 bytes

@VSaric VSaric merged commit 8aa3263 into develop Jan 31, 2023
@VSaric VSaric deleted the navigation-and-reject-all-signature-requests branch January 31, 2023 15:29
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Cannot navigate through multiple Sign prompts for Signed Typed Data V3 and V4
8 participants