Skip to content

fix: use transactionMeta for TransactionController events#24003

Merged
ccharly merged 4 commits intodevelopfrom
fix/user-ops-transaction-meta-events
Apr 30, 2024
Merged

fix: use transactionMeta for TransactionController events#24003
ccharly merged 4 commits intodevelopfrom
fix/user-ops-transaction-meta-events

Conversation

@ccharly
Copy link
Copy Markdown
Contributor

@ccharly ccharly commented Apr 12, 2024

Description

Use of a wrong field name which ends up as an error once published.

ses-user-ops

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/accounts-planning/issues/359

Manual testing steps

  1. Create a 4337 account using: https://metamask.github.io/snap-account-abstraction-keyring/latest/
  • You might need to change the EIP_4337_ENTRYPOINT in your .metamaskrc or builds.yml (or he might already be up-to-date)
  1. Send some ETH to your newly created account
  2. Try to send back some ETH to any account
  • The transaction should now succeed (it was failing before this fix)

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • 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.

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.

@ccharly ccharly added type-bug Something isn't working area-transactions labels Apr 12, 2024
@ccharly ccharly requested a review from a team as a code owner April 12, 2024 15:34
@github-actions
Copy link
Copy Markdown
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
Copy Markdown
Member

@mikesposito mikesposito left a comment

Choose a reason for hiding this comment

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

Is there a way to test that the _onUserOperationTransactionUpdated function does what it is expected to do?

The _ suggests that it's intended as private function and we don't usually add tests for private functions directly, but perhaps we could test that the transaction-updated event is handled properly?

@ccharly
Copy link
Copy Markdown
Contributor Author

ccharly commented Apr 15, 2024

I must say that I don't really know 😅

We did a small investigation with @montelaidev and we found out what was this error. We were doing manual tests though...

I don't know if the e2e tests should cover this one (implicitly)... Any thought regarding the best approach to test this @matthewwalsh0?

Copy link
Copy Markdown
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Good catch. I must have missed this in the TransactionController upgrade in #23252.

Copy link
Copy Markdown
Contributor

@montelaidev montelaidev left a comment

Choose a reason for hiding this comment

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

Tested with @ccharly

@ccharly ccharly force-pushed the fix/user-ops-transaction-meta-events branch from d2c84b7 to d69b91c Compare April 24, 2024 15:38
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [d69b91c]
Page Load Metrics (818 ± 551 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint571731012914
domContentLoaded96724147
load4627178181146551
domInteractive96724147
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -7 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.28%. Comparing base (9cd8c79) to head (f06f660).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #24003   +/-   ##
========================================
  Coverage    67.28%   67.28%           
========================================
  Files         1275     1275           
  Lines        49707    49707           
  Branches     12916    12916           
========================================
  Hits         33444    33444           
  Misses       16263    16263           

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

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [f06f660]
Page Load Metrics (1675 ± 830 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint8458315510249
domContentLoaded11301436129
load67411716751729830
domInteractive11301436129
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -7 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@ccharly ccharly merged commit 8a0e455 into develop Apr 30, 2024
@ccharly ccharly deleted the fix/user-ops-transaction-meta-events branch April 30, 2024 07:48
@github-actions github-actions bot locked and limited conversation to collaborators Apr 30, 2024
@k-g-j
Copy link
Copy Markdown
Contributor

k-g-j commented May 21, 2024

Testing on Chrome Version 125.0.6422.61 with the Flask build linked here

❌ The extension shows a forever loading screen when I go to try and send funds from my 4337 Account back to my main EOA account.

Screen.Recording.2024-05-21.at.1.24.40.PM.mov

@gauthierpetetin gauthierpetetin added the release-12.0.0 Issue or pull request that will be included in release 12.0.0 label Jun 6, 2024
@k-g-j
Copy link
Copy Markdown
Contributor

k-g-j commented Jun 12, 2024

Using Flask build 12.0.0 046766c1

Testing on Chrome Version 126.0.6478.57 ✅

pr-24003-chrome-validation.mov

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-transactions release-12.0.0 Issue or pull request that will be included in release 12.0.0 type-bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants