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: ensure edit nonce input only accepts numbers #8227

Merged
merged 11 commits into from
Feb 15, 2024

Conversation

vinistevam
Copy link
Contributor

@vinistevam vinistevam commented Jan 9, 2024

Description

This PR ensures the input field for edit nonce only accepts numbers.

Related issues

Fixes: #6857

Manual testing steps

  1. Enable Edit nonce from Advanced Settings
  2. Initiate a transaction
  3. Click Edit nonce
  4. Input any value adding letters
  5. Accept
  6. Proceed with the transaction

Screenshots/Recordings

Before

After

numericNonce.webm

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • 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.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@vinistevam vinistevam requested a review from a team as a code owner January 9, 2024 11:16
Copy link
Contributor

github-actions bot commented Jan 9, 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.

@vinistevam vinistevam added the team-confirmations-system DEPRECATED: please use "team-confirmations" label instead label Jan 9, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8ec9970) 41.08% compared to head (9156cda) 41.09%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8227   +/-   ##
=======================================
  Coverage   41.08%   41.09%           
=======================================
  Files        1245     1245           
  Lines       30330    30332    +2     
  Branches     2962     2962           
=======================================
+ Hits        12462    12464    +2     
  Misses      17125    17125           
  Partials      743      743           

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

Copy link
Contributor

github-actions bot commented Jan 9, 2024

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/93d86368-ea65-4a30-9c6f-fba937a9223d
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

OGPoyraz
OGPoyraz previously approved these changes Jan 9, 2024
@sleepytanya
Copy link
Contributor

sleepytanya commented Jan 9, 2024

Adding nonnumerical characters works fine - letters are ignored:

normal_nonce.mov

Adding numbers AND letters leads to higher nonce stuck transaction (Etherscan unable to locate hash):

high_nonce.mov
Screenshot 2024-01-09 at 12 25 37 PM

@sleepytanya
Copy link
Contributor

Editing nonce by manual input using numbers only (while having higher nonce stuck transactions) results in wrong high nonce:

number.mov

Editing nonce using "+-" buttons works normal:

plus_nonce.mov

@sleepytanya
Copy link
Contributor

sleepytanya commented Jan 10, 2024

Same bug exists on main - manual editing using numbers only results in higher nonce stuck transaction.

main.mov

@sleepytanya
Copy link
Contributor

Probably it is not a bug since we use computer keyboard to input characters on local build while on real Android device keyboard does not appear. Need to confirm the keyboard is unavailable on other mobile devices as well. If we don't get keyboard on mobile devices current issue is not a bug.

@vinistevam vinistevam added the Run Smoke E2E Triggers smoke e2e on Bitrise label Jan 25, 2024
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/cc368c88-b503-4fac-b53e-9a6538f84c3f
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@vinistevam vinistevam added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 30, 2024
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/9d4ace87-efb2-419d-a48b-00fefcd37565
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@vinistevam vinistevam removed the Run Smoke E2E Triggers smoke e2e on Bitrise label Jan 30, 2024
@sleepytanya
Copy link
Contributor

I'm not able to use any other symbols but numbers in the 'edit nonce'. I'm able to edit nonce numbers on Confirmation screen using = / - buttons and numbers (cut-n-paste). But the transaction submits with next nonce instead of custom one.

nonce.mov

@sleepytanya sleepytanya added the QA Passed A successful QA run through has been done label Feb 14, 2024
@sleepytanya
Copy link
Contributor

Editing nonce works as expected, low nonce value prompts the error message, high nonce transaction submits successfully.
Samsung s24 + physical device, QA build:

Screen_Recording_20240214_110346_MetaMask-QA.mp4

Copy link

sonarcloud bot commented Feb 15, 2024

@vinistevam vinistevam merged commit cd698b6 into main Feb 15, 2024
26 checks passed
@vinistevam vinistevam deleted the fix/only-integer-edit-nonce branch February 15, 2024 09:00
@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 2024
@metamaskbot metamaskbot added the release-7.17.0 Issue or pull request that will be included in release 7.17.0 label Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed A successful QA run through has been done release-7.17.0 Issue or pull request that will be included in release 7.17.0 team-confirmations-system DEPRECATED: please use "team-confirmations" label instead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Unhandled error Cannot convert string to buffer whenever inputing a non-integer nonce
7 participants