fix(predict): prevent pay token alert flicker#30108
Conversation
|
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. |
b2f92a2 to
1878e1d
Compare
1878e1d to
d189f4d
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These changes affect the Predict buy flow - specifically error handling and quote amount precision. The risk is medium as it changes user-facing behavior in the prediction market buy flow. Tag selection rationale:
No other tags are needed as the changes don't touch swap infrastructure, network management, accounts, or other unrelated features. Performance Test Selection: |
|



Description
Fixes a Predict pay-with-any-token alert flicker where a blocking pay-token alert could briefly take precedence while payment quotes/totals were still settling.
Problem:
blockingPayAlertMessagecould be treated as ready and suppress the active order banner / surface an insufficient-funds style message too early.Fix:
isPaySystemSettlingintousePredictBuyError.Changelog
CHANGELOG entry: Fixed a bug that caused Predict pay-with-any-token alerts to flicker while quotes were loading
Related issues
https://consensyssoftware.atlassian.net/browse/CONF-1345
Manual testing steps
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Touches Predict pay-with-any-token settling and error-surfacing logic, which could change when users see blocking balance alerts vs. order failure banners during quote updates.
Overview
Prevents blocking pay-token balance alerts from flickering/overriding active-order error banners while the Transaction Pay system is still settling after token/amount changes.
Normalizes the pay-system “settling key” by rounding the tracked quote amount up to 2 decimals, and threads
isPaySystemSettlingintousePredictBuyErrorso pay alerts are suppressed until settling completes. Adds a focused unit test to cover settling-time suppression behavior.Reviewed by Cursor Bugbot for commit d189f4d. Bugbot is set up for automated code reviews on this repo. Configure here.