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: substr undefined when cancelling a legacy transaction #8274

Merged
merged 11 commits into from
Jan 19, 2024

Conversation

vinistevam
Copy link
Contributor

@vinistevam vinistevam commented Jan 15, 2024

Description

This PR aims to fix an issue when cancelling a legacy transaction parsing the data property when the property is undefined. The call for parsing comes from the gasPooling which checks it periodically.

Related issues

Fixes: #7149

Manual testing steps

  1. Add Bnb Testnet https://chainlist.org/?testnets=true&search=bnb
  2. Click Send
  3. Add any amount and recipient
  4. Cancel the tx
  5. Should get back to the wallet and allow new operations

Screenshots/Recordings

Before

After

legacy-transaction.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.

@vinistevam vinistevam added the team-confirmations-system DEPRECATED: please use "team-confirmations" label instead label Jan 15, 2024
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.

@vinistevam vinistevam marked this pull request as ready for review January 15, 2024 14:25
@vinistevam vinistevam requested a review from a team as a code owner January 15, 2024 14:25
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/05c870cd-3856-4e24-b92c-0399ce622849
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c2ae63c) 40.20% compared to head (d6ca22a) 40.24%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8274      +/-   ##
==========================================
+ Coverage   40.20%   40.24%   +0.03%     
==========================================
  Files        1235     1235              
  Lines       29926    29927       +1     
  Branches     2872     2872              
==========================================
+ Hits        12033    12044      +11     
+ Misses      17200    17190      -10     
  Partials      693      693              

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

@vinistevam
Copy link
Contributor Author

vinistevam commented Jan 16, 2024

@vinistevam vinistevam changed the title fix: substr undefined when canceling a legacy transaction fix: substr undefined when cancelling a legacy transaction Jan 16, 2024
OGPoyraz
OGPoyraz previously approved these changes Jan 16, 2024
@sleepytanya
Copy link
Contributor

Android QA build - cancelling legacy transaction works as expected:

bnb.mov

Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/34175ccb-914c-46e7-aa3d-a576d1faa27c
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

Copy link

sonarcloud bot commented Jan 19, 2024

@vinistevam vinistevam merged commit af15f55 into main Jan 19, 2024
26 checks passed
@vinistevam vinistevam deleted the fix/cancel-legacy-tx-throws-substr-undefined branch January 19, 2024 07:51
@github-actions github-actions bot locked and limited conversation to collaborators Jan 19, 2024
@metamaskbot metamaskbot added the release-7.16.0 Issue or pull request that will be included in release 7.16.0 label Jan 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.16.0 Issue or pull request that will be included in release 7.16.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] Cancel Legacy tx throws error Cannot read property 'substr' of undefined
6 participants