Skip to content

fix: miles estimate flickering and confirmation screen stability#82

Merged
passandscore merged 3 commits intomainfrom
miles-bug
Mar 24, 2026
Merged

fix: miles estimate flickering and confirmation screen stability#82
passandscore merged 3 commits intomainfrom
miles-bug

Conversation

@passandscore
Copy link
Contributor

Summary

  • Barter validation error handling: Network errors/timeouts no longer falsely flag swaps as "too small" — the previous state is preserved instead, eliminating the miles estimate flickering on valid swaps
  • Confirmation modal freezes quote values on open: All quote-dependent props (amounts, exchange rate, price impact, miles, slippage limits, gas estimate, token prices) are snapshotted when the modal opens so live re-quotes don't shift displayed values or the values sent to the wallet

Test plan

  • Open a ~$100 USDC → ETH swap and verify miles estimate doesn't flicker to "swap too small"
  • Open confirmation modal, wait for a quote refresh cycle, verify all values remain static
  • Confirm swap and verify wallet receives the values shown on the review screen
  • Test wrap/unwrap flow still works correctly
  • Test approval + swap flow (Permit path) with the frozen values

Network errors in barter validation were incorrectly setting
amountTooSmall=true, causing miles estimates to flicker away and
the "swap too small" message to appear briefly on valid swaps.
Snapshot all quote-dependent props (amounts, rates, prices, miles,
slippage limits) into a ref when the modal opens. Live quote refreshes
behind the modal no longer shift displayed values or the values passed
to the wallet on confirm.
@vercel
Copy link

vercel bot commented Mar 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fastprotocolapp Ready Ready Preview, Comment Mar 23, 2026 7:22pm

Request Review

@passandscore passandscore merged commit 42a619c into main Mar 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant