Skip to content

fix(bridge-status-controller): preserve original transaction id when recording intent swaps in history#8655

Merged
dawnseeker8 merged 3 commits intomainfrom
fix/ondo-intent-swap-activity-status-mismatch
May 4, 2026
Merged

fix(bridge-status-controller): preserve original transaction id when recording intent swaps in history#8655
dawnseeker8 merged 3 commits intomainfrom
fix/ondo-intent-swap-activity-status-mismatch

Conversation

@dawnseeker8
Copy link
Copy Markdown
Contributor

@dawnseeker8 dawnseeker8 commented Apr 30, 2026

Explanation

When submitIntent records a synthetic transaction in the bridge history under the orderUid key, it needs to keep a back-reference to the original TransactionController entry so subsequent status updates from intent polling can update the right transaction.

Previously this back-reference was set on bridgeTxMeta.originalTransactionId, but #addTxToHistorygetInitialHistoryItem destructures originalTransactionId from the top-level argument, not from bridgeTxMeta. As a result the field on bridgeTxMeta was a no-op and the history item silently fell back to bridgeTxMeta.id (the orderUid), severing the link between the bridge history record and the synthetic TransactionController entry. This caused the activity status of Ondo intent swaps to get out of sync with the underlying transaction.

This PR:

  • Removes originalTransactionId from bridgeTxMetaForHistory (where it had no effect).
  • Passes originalTransactionId: syntheticMeta.id as a top-level argument to #addTxToHistory, which is where getInitialHistoryItem actually reads it.
  • Adds a comment explaining why this argument has to live at the top level so the next reader doesn't fall into the same trap.

Behavior change: the bridge history item for an intent swap is now correctly linked to its synthetic TransactionController transaction, so activity-screen status reflects the real intent order status instead of getting stuck.

References

Fixes the Ondo intent swap activity status mismatch.

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

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 submitIntent passes originalTransactionId as a top-level argument to #addTxToHistory when re-keying history items by orderUid, instead of (ineffectively) setting it on bridgeTxMeta.

This preserves the back-reference from the bridge history item to the synthetic TransactionController transaction 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.

…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.
@dawnseeker8 dawnseeker8 requested a review from a team as a code owner April 30, 2026 12:21
…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.
@dawnseeker8 dawnseeker8 requested a review from a team as a code owner April 30, 2026 12:40
@dawnseeker8
Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]
@metamask-previews/[email protected]

@dawnseeker8 dawnseeker8 added this pull request to the merge queue May 4, 2026
Merged via the queue into main with commit 00d23d2 May 4, 2026
368 checks passed
@dawnseeker8 dawnseeker8 deleted the fix/ondo-intent-swap-activity-status-mismatch branch May 4, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants