fix(deposit): hydrate provider token on Deposit root entry cp-7.72.0#28288
fix(deposit): hydrate provider token on Deposit root entry cp-7.72.0#28288
Conversation
Always run checkExistingToken before branching so stored auth is restored when reopening Deposit without a CREATED order. Reorganize initializeFlow for clarity. Update Root tests.
|
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.
Prevent duplicate checkExistingToken and navigation when the effect re-runs while the async token check is in flight (e.g. orders update). initializationInFlight is set synchronously; hasCheckedToken remains set after the token attempt completes.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
This is a behavioral change in the Deposit/Ramp flow initialization that could affect how users enter the deposit flow. The SmokeRamps tag covers fiat on-ramp/off-ramp features and is the appropriate tag to validate this change. No other features are impacted - the change is entirely contained within the Deposit Root component. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|




Description
Deposit
Rootpreviously calledcheckExistingToken()only when a fiat order inCREATEDstate existed in Redux. If the user had completed Verify / Email / OTP and stored a provider token, then closed Deposit and reopened it without an in-progressCREATEDorder, the vault was never read andisAuthenticatedstayed false—so Build Quote sent them through the login flow again.This change always runs
checkExistingToken()(with the existing timeout) before branching to Build Quote, Enter Email, or Bank Details, so the stored token hydrates the SDK on every Deposit entry.initializeFlowis reorganized to match that order (guard → default auth → attempt vault read →finallymark token check complete → branch oncreatedOrder).Changelog
CHANGELOG entry: Fixed Deposit prompting for login again after closing and reopening the flow when a stored session was still valid.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes Deposit root initialization to always attempt stored-token hydration and to gate navigation decisions on that result, which can affect authentication and routing behavior. Adds re-entrancy guards to avoid duplicate async initialization, reducing race-condition risk but making flow control more complex.
Overview
Ensures Deposit
Rootalways runscheckExistingToken()(with timeout/error handling) on entry before deciding whether to route to Build Quote, Enter Email, or Bank Details, fixing cases where users were re-prompted to authenticate despite a valid stored provider token.Reworks initialization flow to be idempotent and single-flight via
hasCheckedTokenplus a newinitializationInFlightguard, and updates the Root test to assert token hydration occurs even when there is noCREATEDorder before redirecting toBUILD_QUOTE.Written by Cursor Bugbot for commit 513271a. This will update automatically on new commits. Configure here.