Skip to content

Commit f775385

Browse files
weitingsunSteP-n-s
andauthored
chore: cherry-pick fix: delay for 5s after submitting Base approval cp-7.56.0 (#20269)
- fix: delay for 5s after submitting Base approval cp-7.56.0 (#20190) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Patches these changes into the bridge-status-controller: MetaMask/core#6674 The change adds a 5s delay after the approval submission to reduce bridge transaction failures on Base <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: fix: delay for 5s after submitting Base approval for swap ## **Related issues** Fixes: #20193 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> N/A ### **After** <!-- [screenshots/recordings] --> No visual changes, but there should be a 5s delay between the approval tx's submission and the trade tx on Base ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: SteP-n-s <[email protected]> [c26469d](c26469d)
2 parents bb1a687 + a5f28e8 commit f775385

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/@metamask/bridge-status-controller/dist/utils/transaction.cjs b/node_modules/@metamask/bridge-status-controller/dist/utils/transaction.cjs
2+
index 676f623..3b2eb1d 100644
3+
--- a/node_modules/@metamask/bridge-status-controller/dist/utils/transaction.cjs
4+
+++ b/node_modules/@metamask/bridge-status-controller/dist/utils/transaction.cjs
5+
@@ -103,7 +103,7 @@ const handleSolanaTxResponse = (snapResponse, quoteResponse, selectedAccount) =>
6+
};
7+
exports.handleSolanaTxResponse = handleSolanaTxResponse;
8+
const handleLineaDelay = async (quoteResponse) => {
9+
- if (bridge_controller_1.ChainId.LINEA === quoteResponse.quote.srcChainId) {
10+
+ if ([bridge_controller_1.ChainId.LINEA, bridge_controller_1.ChainId.BASE].includes(quoteResponse.quote.srcChainId)) {
11+
const debugLog = (0, utils_1.createProjectLogger)('bridge');
12+
debugLog('Delaying submitting bridge tx to make Linea confirmation more likely');
13+
const waitPromise = new Promise((resolve) => setTimeout(resolve, constants_1.LINEA_DELAY_MS));

0 commit comments

Comments
 (0)