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: Send ETH using Deeplinks sets incorrect amount if is a thousand or higher #7998

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

blackdevelopa
Copy link
Contributor

@blackdevelopa blackdevelopa commented Dec 4, 2023

Description

This PR simplifies the numeric value parsed from the deeplink url, removing decimals and adjusting based on the exponent.

Related issues

Fixes: #7769

Manual testing steps

  1. Go to https://metamask.github.io/metamask-deeplinks/#
  2. Set a huge amount
  3. Scan
  4. See how the amount displayed on the confirm screen is same as what was set in the deeplink

Screenshots/Recordings

Before

send-deeplink-high.mp4

After

RPReplay_Final1701706536.MP4

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.

Copy link
Contributor

github-actions bot commented Dec 4, 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.

@blackdevelopa blackdevelopa added the team-confirmations-secure-ux-PR PR from the confirmations team label Dec 4, 2023
@blackdevelopa blackdevelopa force-pushed the 7769/deeplink_incorrect_value branch 2 times, most recently from 8b2321a to 733c0c0 Compare December 8, 2023 15:20
@blackdevelopa blackdevelopa added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Dec 8, 2023
@blackdevelopa blackdevelopa self-assigned this Dec 8, 2023
@blackdevelopa blackdevelopa marked this pull request as ready for review December 8, 2023 16:20
@blackdevelopa blackdevelopa requested a review from a team as a code owner December 8, 2023 16:20
Copy link
Contributor

github-actions bot commented Dec 8, 2023

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2c885202-b37f-4770-8bd3-d4d760dbc783
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

omridan159
omridan159 previously approved these changes Dec 11, 2023
segun
segun previously approved these changes Dec 11, 2023
@codecov-commenter
Copy link

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (ca25073) 39.39% compared to head (7a1e436) 39.40%.
Report is 1 commits behind head on main.

Files Patch % Lines
...core/DeeplinkManager/Handlers/handleEthereumUrl.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7998   +/-   ##
=======================================
  Coverage   39.39%   39.40%           
=======================================
  Files        1220     1221    +1     
  Lines       29800    29804    +4     
  Branches     2831     2831           
=======================================
+ Hits        11740    11743    +3     
- Misses      17371    17372    +1     
  Partials      689      689           

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

Copy link

sonarcloud bot commented Dec 18, 2023

@blackdevelopa blackdevelopa merged commit 96567e2 into main Dec 20, 2023
26 checks passed
@blackdevelopa blackdevelopa deleted the 7769/deeplink_incorrect_value branch December 20, 2023 13:34
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2023
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Dec 20, 2023
@metamaskbot metamaskbot added the release-7.15.0 Issue or pull request that will be included in release 7.15.0 label Dec 20, 2023
@blackdevelopa blackdevelopa changed the title fix: Send ETH using Deeplinks sets incorrect amount if is way higher than balance fix: Send ETH using Deeplinks sets incorrect amount if is a thousand or higher Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.15.0 Issue or pull request that will be included in release 7.15.0 team-confirmations-secure-ux-PR PR from the confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Send ETH using Deeplinks sets incorrect amount if is way higher than balance
6 participants