Skip to content

Conversation

micaelae
Copy link
Member

@micaelae micaelae commented Aug 30, 2025

Explanation

This change fixes a bug in Solana post-submission logic in which the txHistory key is set to a random uuid instead of the tx hash. This causes txHistory lookups by txHash (for Solana transactions) to fail on the clients

This is not a breaking change, but requires a migration on the clients to set the txHistory key to the historyItem.status?.srcChain?.txHash value for Solana transactions. This fixes txHistory items created prior to this version of the bridge-status-controller

Migration script for extension: https://github.com/MetaMask/metamask-extension/pull/35539/files#diff-3cd53aba68cf73714b1dbe70345a0b896589f13d8c3cc370d04393a5c6b4f0d8

This PR also fixes properties for the swap Completed events so that they read data from the txHistory, if it exists

References

Fixes https://consensyssoftware.atlassian.net/browse/SWAPS-2595

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@micaelae micaelae requested a review from a team as a code owner August 30, 2025 00:49
cursor[bot]

This comment was marked as outdated.

@micaelae micaelae requested a review from a team as a code owner September 2, 2025 16:45
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Transaction Property Tracking Fails Post-Removal

The removal of getEVMTxPropertiesFromTransactionMeta from swap completion event tracking removes a fallback for transaction properties. This causes analytics events to fire with empty data if the transaction isn't found in txHistory, which can happen due to race conditions or ignored errors during submitTx. This results in incomplete tracking data.

packages/bridge-status-controller/src/bridge-status-controller.ts#L224-L237

this.messagingSystem.subscribe(
'TransactionController:transactionConfirmed',
(transactionMeta) => {
const { type, id, chainId } = transactionMeta;
if (type === TransactionType.swap) {
this.#trackUnifiedSwapBridgeEvent(
UnifiedSwapBridgeEventName.Completed,
id,
);
}
if (type === TransactionType.bridge && !isSolanaChainId(chainId)) {
this.#startPollingForTxId(id);
}
},

Fix in Cursor Fix in Web


@micaelae micaelae merged commit 15d58bd into main Sep 2, 2025
235 checks passed
@micaelae micaelae deleted the swaps2575-fix-txhistory-key-for-solana branch September 2, 2025 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants