MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.57k stars 4.73k forks source link

fix: Update filtering of STX for the Activity list #24540

Open dan437 opened 2 weeks ago

dan437 commented 2 weeks ago

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

Pre-merge reviewer checklist

github-actions[bot] commented 2 weeks ago

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.

metamaskbot commented 2 weeks ago
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%)