Skip to content

fix: quote request should not be sent of amount of token requested by the user is 0#8554

Open
jpuri wants to merge 39 commits intomainfrom
quote_check
Open

fix: quote request should not be sent of amount of token requested by the user is 0#8554
jpuri wants to merge 39 commits intomainfrom
quote_check

Conversation

@jpuri
Copy link
Copy Markdown
Contributor

@jpuri jpuri commented Apr 23, 2026

Explanation

Money account page updated transaction a few times, this change ensure that we get quote only of token amount requested is not 0.

References

Fixes https://consensyssoftware.atlassian.net/browse/CONF-1241

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

Medium Risk
Medium risk: changes quote-refresh behavior and can prevent downstream quote/total updates if token amount detection is incorrect, though scoped to a simple precondition check.

Overview
Prevents unnecessary quote API calls by short-circuiting updateQuotes when all non-skipIfBalance required tokens have amountRaw === '0', while still allowing quoting when isMaxAmount is true (or when tokens are absent).

Adds test coverage for the new skip/allow conditions and documents the fix in the package changelog.

Reviewed by Cursor Bugbot for commit 6efd589. Bugbot is set up for automated code reviews on this repo. Configure here.

}

log('Updating quotes', { transactionId });

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On money account page token / accountOverride can be updated few times. We need to ensure that quotes is not refetched unless user enters a non-zero token amount. Thus this change is made.

Another approach could be to change methods setTransactionConfig, 'setPaymentToken' to not refresh quote is amount of token requested is zero.

Base automatically changed from acc_override_support to main April 23, 2026 09:55
@jpuri jpuri marked this pull request as ready for review April 23, 2026 09:57
@jpuri jpuri requested review from a team as code owners April 23, 2026 09:57
@jpuri jpuri enabled auto-merge April 24, 2026 02:37
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cc70919. Configure here.

Comment thread packages/transaction-pay-controller/src/utils/quotes.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant