fix: wait for bridge tx submission before navigating to activity log#40173
Merged
fix: wait for bridge tx submission before navigating to activity log#40173
Conversation
Contributor
✨ Files requiring CODEOWNER review ✨🔄 @MetaMask/swaps-engineers (2 files, +7 -5)
|
Contributor
Builds ready [4b04169]
UI Startup Metrics (1394 ± 98 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
micaelae
commented
Feb 17, 2026
| } else { | ||
| navigate(`${DEFAULT_ROUTE}?tab=activity`); | ||
| navigate(`${DEFAULT_ROUTE}?tab=activity`, { | ||
| state: { stayOnHomePage: true }, |
Member
Author
There was a problem hiding this comment.
When using the sidepanel extension, this causes the UI to navigate to the activity list if submission fails. Currently the user doesn't get an indication that their tx failed
ghgoodreau
approved these changes
Feb 17, 2026
SteP-n-s
approved these changes
Feb 17, 2026
Contributor
Builds ready [4e21743]
UI Startup Metrics (1393 ± 107 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
This is what currently happens when a user submits a swap/bridge tx
Since the async
submitTxhandler is not awaited, #4 can happen before steps 1-3, which causes the tracking error described in the bug ticket. This scenario is only possible if the user submits the trade right after they receive it and their network connection is slowChangelog
CHANGELOG entry: fix: swap tx submission fails if page navigates to Activity log before QuotesReceived event is published
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-4060 , #39871
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Small control-flow change to await an existing async submission before navigation; low risk but could affect perceived UI timing if the background call is slow.
Overview
Ensures bridge/swap submissions fully complete before routing the user to the Activity tab to avoid losing side effects (e.g., metrics/state updates) on page unload.
This makes
submitBridgeTxasync and updatesuseSubmitBridgeTransactionto await the thunk creation and dispatch for both non-EVM and EVM flows. It also makes error navigation to Activity consistent by passingstate: { stayOnHomePage: true }when redirecting after failures.Written by Cursor Bugbot for commit 4e21743. This will update automatically on new commits. Configure here.