-
-
Notifications
You must be signed in to change notification settings - Fork 268
fix: use txMeta.actionId as a temporary key to capture data for non-STX where it fails before submission #7696
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
Merged
+620
−43
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 tasks
…ils before submission
- Make bridgeTxMeta optional in StartPollingForBridgeTxStatusArgs type - Add explicit validation in startPollingForBridgeTxStatus requiring bridgeTxMeta.id - Add test for undefined bridgeTxMeta case
ee23916 to
ef54173
Compare
Extract history key determination logic into a pure function to improve test coverage. The function validates that either actionId or bridgeTxMetaId is provided, throwing if neither is available.
Extract intent validation logic into a pure function to improve test coverage. The function validates that intent data exists in the quote response, throwing if missing.
…istory Since bridgeTxMeta is now optional, we don't need to pass an empty object when adding pre-submission history. The actionId is used as the key instead.
ghgoodreau
approved these changes
Jan 22, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation
This PR changes the way that
BridgeStatusController's history items are keyed for non-STX to improve status tracking and addressing some gaps in analytics.actionId, keyhistoryItembyactionIdand add to state BEFORE submitting tx. Previously we would not even have ahistoryItem, if the the tx failed before being submitted on chain.actionIdtoTransactionController.addTransaction()as a part of the requestactionIdto theirtxMeta.idtransactionFailedusetxMeta.actionIdto identify txs that failed before actually being submitted on chain and handle metricsYou can test this by using a Smart Account on Polygon and attempting to do a USDT > POL swap that requires an approval. You should see error
In flight transaction limit reached for delegate accountsin the logs. When you check Mixpanel, theproviderfield should be properly filled out. A video of the whole process in in MetaMask/metamask-mobile#25010.References
Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-3591
Related to MetaMask/metamask-mobile#25010
Checklist
Note
Improves robustness of transaction tracking and analytics around pre-submission failures.
actionIdas a temporary history key for non-batch EVM submissions; storeactionIdinBridgeHistoryItemand rekey totxMeta.idafter successful submission (updatingtxMetaIdandsrcTxHash)TransactionController:transactionFailed, look up history bytxMeta.idthenactionIdto mark failed and track metrics; skip tracking forrejectedstatusbridgeTxMeta.idrequirement instartPollingForBridgeTxStatus; exclude items withouttxMetaIdfrom restart pollinggetHistoryKeyandgetIntentFromQuoteutils; makeBridgeHistoryItem.txMetaIdoptional andStartPollingForBridgeTxStatusArgs.bridgeTxMetaoptional; expand tests and snapshots accordinglyWritten by Cursor Bugbot for commit 385b6d8. This will update automatically on new commits. Configure here.