metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

fix: Update filtering of STX for the Activity list

Open dan437 opened this issue 1 year ago • 2 comments

Description

Update filtering of STX for the Activity list. There was a rare edge case when we showed a duplicated transaction in the Activity list when the transaction status was "unknown" due to reverting on chain. Now backend returns "reverted" for such transactions instead of "unknown", but just in case we have updated client-side code to only show "unknown" non-swaps transactions once in the Activity list.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Have at least one smart transaction submitted e.g. on Sepolia
  2. In the smartTransactionsListSelector function you can artificially add a new smart transaction with the status "unknown". It should not show up in the Activity list.
const smartTransactions =
    state.metamask.smartTransactionsState?.smartTransactions?.[
      getCurrentChainId(state)
    ];
const smartTransactionsCopy = [...smartTransactions];
smartTransactionsCopy.push({
  ...smartTransactions[0],
  status: 'unknown',
  type: 'contractInteraction',
  statusMetadata: {
    ...smartTransactions[0].statusMetadata,
    minedTx: 'unknown',
  },
});

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.

dan437 avatar May 15 '24 13:05 dan437

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.

github-actions[bot] avatar May 15 '24 13:05 github-actions[bot]

Builds ready [58b57b2]
Page Load Metrics (1161 ± 647 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint70168912311
domContentLoaded9241242
load56318411611348647
domInteractive9241242
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 380 Bytes (0.01%)

metamaskbot avatar May 15 '24 14:05 metamaskbot

Codecov Report

Attention: Patch coverage is 72.72727% with 6 lines in your changes missing coverage. Please review.

Project coverage is 65.74%. Comparing base (c9e944d) to head (6176218). Report is 11 commits behind head on develop.

Files Patch % Lines
ui/selectors/transactions.js 72.73% 6 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #24540      +/-   ##
===========================================
+ Coverage    65.72%   65.74%   +0.01%     
===========================================
  Files         1360     1360              
  Lines        54043    54064      +21     
  Branches     14036    14047      +11     
===========================================
+ Hits         35518    35539      +21     
  Misses       18525    18525              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 06 '24 12:06 codecov[bot]

Builds ready [6176218]
Page Load Metrics (204 ± 285 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6766313612962
domContentLoaded96417126
load402784204593285
domInteractive96317126
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 380 Bytes (0.01%)

metamaskbot avatar Jun 07 '24 15:06 metamaskbot