Skip to content

chore(runway): cherry-pick fix(social-leaderboard): keep QuickBuy Sell enabled when position price ticks - #34470

Merged
runway-github[bot] merged 1 commit into
release/8.7.0from
runway-cherry-pick-8.7.0-1786111669
Aug 7, 2026
Merged

chore(runway): cherry-pick fix(social-leaderboard): keep QuickBuy Sell enabled when position price ticks#34470
runway-github[bot] merged 1 commit into
release/8.7.0from
runway-cherry-pick-8.7.0-1786111669

Conversation

@runway-github

@runway-github runway-github Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes QuickBuy Sell staying disabled after entering a valid amount
even when a quote is on screen (silent "Sell" label, no
insufficient-funds/gas/no-quotes error).

Root cause: In sell mode, sourceTokenAmount was derived from the
live positionToken.currencyExchangeRate. Market-data ticks changed the
token amount for the same fiat input, so isPendingQuoteRefresh stayed
true and the CTA never enabled. Buy mode avoids this because the
pay-with token is a useState snapshot.

Fix:

  1. Freeze the sell-mode exchange rate used for quote amount conversion
    (display/balance rates stay live).
  2. Fall back to matching quote.srcTokenAmount when sentAmount is
    missing/mismatched (partial QuoteMetadata).

Changelog

CHANGELOG entry: Fixed Quick Buy Sell button staying disabled after
entering a valid amount

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TSA-976

Manual testing steps

Feature: Quick Buy sell CTA

  Scenario: sell remains actionable after a price tick
    Given Quick Buy is open in Sell mode for a priced position token
    And the user enters a valid fiat amount
    And a quote is shown (total includes network fee)

    When the position token market price updates
    Then the Sell button stays enabled
    And the committed source token amount does not change

Screenshots/Recordings

N/A — logic-only fix; covered by unit regression tests.

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs and MetaMask Mobile Coding
    Standards.
  • 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 format if applicable
  • I've applied the right labels on the PR

Performance checks (if applicable)

  • I've tested on Android
  • I've tested with a power user scenario
  • I've instrumented key operations with Sentry traces for production
    performance metrics

Pre-merge reviewer checklist

  • I've manually tested the PR
  • 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.

Slack
Thread

Open in Web Open in Cursor 

Co-authored-by: Cursor Agent cursoragent@cursor.com 5449688

…l enabled when position price ticks cp-8.7.0 (#34422)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Description

Fixes QuickBuy **Sell** staying disabled after entering a valid amount
even when a quote is on screen (silent \"Sell\" label, no
insufficient-funds/gas/no-quotes error).

**Root cause:** In sell mode, `sourceTokenAmount` was derived from the
live `positionToken.currencyExchangeRate`. Market-data ticks changed the
token amount for the same fiat input, so `isPendingQuoteRefresh` stayed
true and the CTA never enabled. Buy mode avoids this because the
pay-with token is a `useState` snapshot.

**Fix:**
1. Freeze the sell-mode exchange rate used for quote amount conversion
(display/balance rates stay live).
2. Fall back to matching `quote.srcTokenAmount` when `sentAmount` is
missing/mismatched (partial `QuoteMetadata`).

## Changelog

CHANGELOG entry: Fixed Quick Buy Sell button staying disabled after
entering a valid amount

## Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TSA-976

## Manual testing steps

```gherkin
Feature: Quick Buy sell CTA

  Scenario: sell remains actionable after a price tick
    Given Quick Buy is open in Sell mode for a priced position token
    And the user enters a valid fiat amount
    And a quote is shown (total includes network fee)

    When the position token market price updates
    Then the Sell button stays enabled
    And the committed source token amount does not change
```

## Screenshots/Recordings

N/A — logic-only fix; covered by unit regression tests.

## Pre-merge author checklist

- [x] I've followed MetaMask Contributor Docs and MetaMask Mobile Coding
Standards.
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using JSDoc format if applicable
- [ ] I've applied the right labels on the PR

#### Performance checks (if applicable)

- [ ] I've tested on Android
- [ ] I've tested with a power user scenario
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics

## Pre-merge reviewer checklist

- [ ] I've manually tested the PR
- [ ] 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.

<!-- CURSOR_AGENT_PR_BODY_END -->

[Slack
Thread](https://consensys.slack.com/archives/C092MDPA0LU/p1786029924237309?thread_ts=1786029924.237309&cid=C092MDPA0LU)

<div><a
href="https://cursor.com/agents/bc-9542177a-2aa0-5981-af17-a72f396a726a?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-9542177a-2aa0-5981-af17-a72f396a726a&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
@runway-github
runway-github Bot requested a review from a team as a code owner August 7, 2026 14:07
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamask-ci metamask-ci Bot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - PR targets a release or stable branch (release/* or stable)

All E2E tests pre-selected.

View GitHub Actions results

@github-actions github-actions Bot added size-M risk:medium AI analysis: medium risk labels Aug 7, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

@runway-github
runway-github Bot merged commit 95866e1 into release/8.7.0 Aug 7, 2026
99 checks passed
@runway-github
runway-github Bot deleted the runway-cherry-pick-8.7.0-1786111669 branch August 7, 2026 14:45
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 7, 2026
@metamaskbot metamaskbot added the release-8.7.0 Issue or pull request that will be included in release 8.7.0 label Aug 10, 2026
@gauthierpetetin

Copy link
Copy Markdown
Contributor

No release label on PR. Adding release label release-8.7.0 on PR, as PR was cherry-picked in branch 8.7.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.7.0 Issue or pull request that will be included in release 8.7.0 risk:medium AI analysis: medium risk size-M team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants