fix: prevent infinite quote request loop caused by token warning in unified swaps context cp-7.73.0#28361
Conversation
…core controller instead
|
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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |




Description
When a destination token has a security warning (e.g. a Blockaid malicious/suspicious flag), the unified swaps bridge view was entering an infinite quote request loop.
Root cause:
tokenWarningwas included as a dependency of theuseMemothat builds the analyticscontextobject inuseUnifiedSwapBridgeContext.tokenWarningis itself derived from quote results (blockaid data returned by the bridge controller). This created a feedback cycle:Fix: Remove
tokenWarningfrom theuseMemodependency array and clearsecurity_warningsto[]for now. Thesecurity_warningsfield will be populated properly in the bridge controller instead, removing the React dependency cycle entirely.Changelog
CHANGELOG entry: Fixed a bug that caused repeated quote requests when swapping to a token with a security warning.
Related issues
Fixes: #28367
Manual testing steps
Screenshots/Recordings
Before
N/A
After
Uploading Screen Recording 2026-04-02 at 4.24.51 PM.mov…
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk: small change limited to analytics context memoization, but it temporarily drops
security_warningsdata which could affect warning-related telemetry until re-populated elsewhere.Overview
Prevents an infinite bridge quote re-fetch loop by removing destination token warning state from
useUnifiedSwapBridgeContext’s memoized context object.security_warningsis now always an empty array (TODO) and theuseMemodependency list no longer includes the warning selector, stabilizing thecontextidentity passed intoBridgeController.updateBridgeQuoteRequestParams.Written by Cursor Bugbot for commit 21dec81. This will update automatically on new commits. Configure here.