feat: disable auto-lock during Ramps unified buy v2 flow#26723
Conversation
Temporarily disable the app's auto-lock mechanism while users are in the Ramps unified buy v2 flow. This prevents the app from locking when users minimize it to check personal details, verify identity, or complete payment information with external providers. The implementation mirrors the Card onboarding flow pattern by using LockManagerService to stop/start the AppState listener in the root TokenListRoutes navigator component. Changes: - Modified TokenListRoutes to disable auto-lock on mount and re-enable on unmount - Added comprehensive tests to verify lock behavior Refs: TRAM-3300
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: The changes:
The SmokeRamps tag is appropriate because:
No other tags are needed because:
Performance Test Selection: |
|
Does it have any side effects such as stale data ? |
Description
This PR disables the app's auto-lock mechanism while users are in the Ramps unified buy v2 flow.
Reason for change: When users minimize the app to check personal details, verify their identity, or complete payment information with external providers during the Ramps flow, they get locked out after the configured timeout, forcing them to re-authenticate and disrupting their purchase journey.
Solution: Temporarily disable auto-lock by stopping the
AppStatelistener inLockManagerServicewhen entering the Ramps flow, and re-enable it when exiting. This follows the exact same pattern used by the Card onboarding flow.Technical implementation: The
TokenListRoutescomponent is the root navigator for all Ramps v2 screens. AuseEffecthook callsLockManagerService.stopListening()on mount andLockManagerService.startListening()on unmount, ensuring the entire flow (token selection, build quote, checkout webview, KYC screens, order completion) is covered.Changelog
CHANGELOG entry: Improved Ramps buy flow by preventing auto-lock during checkout
Related issues
Refs: TRAM-3300
Manual testing steps
Screenshots/Recordings
Before
After
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-02-27.at.22.21.39.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes session/lock behavior by disabling the app auto-lock listener while users are in the Ramps flow, which could increase exposure if the flow fails to re-enable listening on exit. Scope is localized to the Ramps route root and covered by a new unit test for mount/unmount behavior.
Overview
Disables auto-lock for the duration of the Ramps unified buy v2 navigation flow by calling
LockManagerService.stopListening()whenTokenListRoutesmounts and restoring it viastartListening()on unmount.Adds a Jest test (
routes.test.tsx) that mounts/unmounts the routes under aNavigationContainerand asserts the lock listener is stopped on entry and restarted on exit.Written by Cursor Bugbot for commit 8549286. This will update automatically on new commits. Configure here.