fix(bridge-status-controller): preserve original transaction id when recording intent swaps in history#8655
Merged
dawnseeker8 merged 3 commits intomainfrom May 4, 2026
Conversation
…a handling - Modify the creation of bridge transaction metadata to use `orderUid` as the key for intent polling. - Ensure `originalTransactionId` is passed as a top-level argument to maintain the link between bridge history records and synthetic TransactionController entries. - Update comments for clarity on the importance of the changes made to the metadata structure.
…ransaction metadata creation - Adjusted comment formatting for clarity in the bridge transaction metadata section, ensuring consistent style and readability. - Added a missing comma in the object definition for `bridgeTxMetaForHistory` to maintain proper syntax.
…inalTransactionId fix
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
micaelae
approved these changes
May 1, 2026
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
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
When
submitIntentrecords a synthetic transaction in the bridge history under theorderUidkey, it needs to keep a back-reference to the originalTransactionControllerentry so subsequent status updates from intent polling can update the right transaction.Previously this back-reference was set on
bridgeTxMeta.originalTransactionId, but#addTxToHistory→getInitialHistoryItemdestructuresoriginalTransactionIdfrom the top-level argument, not frombridgeTxMeta. As a result the field onbridgeTxMetawas a no-op and the history item silently fell back tobridgeTxMeta.id(theorderUid), severing the link between the bridge history record and the syntheticTransactionControllerentry. This caused the activity status of Ondo intent swaps to get out of sync with the underlying transaction.This PR:
originalTransactionIdfrombridgeTxMetaForHistory(where it had no effect).originalTransactionId: syntheticMeta.idas a top-level argument to#addTxToHistory, which is wheregetInitialHistoryItemactually reads it.Behavior change: the bridge history item for an intent swap is now correctly linked to its synthetic
TransactionControllertransaction, so activity-screen status reflects the real intent order status instead of getting stuck.References
Fixes the Ondo intent swap activity status mismatch.
Checklist
Made with Cursor
Note
Medium Risk
Touches intent transaction history keying/linking logic; a small change, but mistakes here could cause bridge activity status to desync or polling updates to target the wrong transaction.
Overview
Fixes intent-swap history linking by ensuring
submitIntentpassesoriginalTransactionIdas a top-level argument to#addTxToHistorywhen re-keying history items byorderUid, instead of (ineffectively) setting it onbridgeTxMeta.This preserves the back-reference from the bridge history item to the synthetic
TransactionControllertransaction so subsequent intent polling updates apply to the correct transaction; the package changelog is updated to document the fix.Reviewed by Cursor Bugbot for commit 60ee344. Bugbot is set up for automated code reviews on this repo. Configure here.