Skip to content

[Bug]: Swap Footer disappears during slippage-triggered re-fetch #29615

@davibroc

Description

@davibroc

Describe the bug

Watch the video below, after a new slippage is entered, sometime the quote and submit button disappear. These is a race condition is in useBridgeQuoteData/index.ts:261 and BridgeViewFooter.tsx:69.

Looking a t the code when slippage changes:

  1. A new quote fetch starts → isLoading = true, quotes cleared from Redux → activeQuote =
    undefined
  2. isExpired is still false (the timer hasn't fired — this is a fresh fetch, not an
    expiry)
  3. So needsNewQuote = false && ... = false
  4. The footer hits line 69: if (isLoading && !activeQuote && !needsNewQuote) return null →
    returns null permanently until the new quote arrives

The needsNewQuote escape hatch (the comment says "treat the edge-case where a fetch IS
running but there is no active quote") requires isExpired=true, but slippage re-fetches
never go through the expiry path.

Proposed fix:

// Before
const needsNewQuote =
isExpired && !isSubmittingTx && (!isLoading || !activeQuote);

// After
const needsNewQuote =
!isSubmittingTx &&
((isExpired && (!isLoading || !activeQuote)) ||
(isLoading && !activeQuote));

I have disabled this test in the pipeline with this PR #29618
Please re-enable the test with the fix

Expected behavior

Quote and submit button don't disappear after entering new slippage

Screenshots/Recordings

bugSlippage.mp4

Steps to reproduce

  1. yarn test:e2e:ios:debug:run tests/smoke/swap/swap-action-smoke.spec.ts

Error messages or log output

Where was this bug found?

Internal release testing

Version

7.76.0

Build number

0000

Build type

None

Device

Samsung Galaxy

Operating system

Android

Additional context

No response

Severity

No response

Metadata

Metadata

Assignees

Labels

Sev2-normalAn issue that may lead to users misunderstanding some limited risks they are takingregression-RC-7.76.0Regression bug that was found in release candidate (RC) for release 7.76.0release-7.78.0Issue or pull request that will be included in release 7.78.0team-swaps-and-bridgeSwaps and Bridge teamtype-bugSomething isn't working

Type

No fields configured for Bug.

Projects

Status
To be triaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions