Skip to content

fix: fallback to recommendedQuote when selectedQuote is stale#8154

Merged
micaelae merged 5 commits intomainfrom
swaps3616-more-quotes
Mar 10, 2026
Merged

fix: fallback to recommendedQuote when selectedQuote is stale#8154
micaelae merged 5 commits intomainfrom
swaps3616-more-quotes

Conversation

@micaelae
Copy link
Member

@micaelae micaelae commented Mar 9, 2026

Explanation

Fixing a bug which causes the UI to get a nonexistent activeQuote on refresh. This updates the selector so it checks whether the selectedQuote exists in the sorted quotes list first, and falls back on the recommendedQuote otherwise

References

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

Note

Low Risk
Small, well-tested change to quote selection logic; primary risk is minor behavior change in how activeQuote is chosen when quotes refresh.

Overview
Fixes stale quote selection by updating selectActiveQuote (used by selectBridgeQuotes) to only return selectedQuote if its requestId still exists in sortedQuotes, otherwise falling back to the recommendedQuote.

Updates unit tests to cover both the valid-selected-quote case and the stale-selected-quote fallback, and adds a changelog entry plus minor JSDoc punctuation/clarifications in QuoteMetadata.

Written by Cursor Bugbot for commit 517219a. This will update automatically on new commits. Configure here.

@micaelae micaelae requested a review from a team as a code owner March 9, 2026 22:42
@micaelae micaelae marked this pull request as draft March 9, 2026 22:42
@micaelae micaelae marked this pull request as ready for review March 10, 2026 16:43
@micaelae micaelae requested a review from a team as a code owner March 10, 2026 16:53
@micaelae micaelae enabled auto-merge March 10, 2026 16:59
@micaelae micaelae added this pull request to the merge queue Mar 10, 2026
Merged via the queue into main with commit 1578bd3 Mar 10, 2026
322 checks passed
@micaelae micaelae deleted the swaps3616-more-quotes branch March 10, 2026 17:01
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.

2 participants