refactor: Move set existing user from login to vault recovery method#24252
refactor: Move set existing user from login to vault recovery method#24252
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThis PR refactors the vault recovery flow by moving the Key changes:
The risk is medium because:
Selected tags rationale:
|
Skipping sonarcloud since we removed code, not adding it |
|



Description
This change moves setting existing user from the
Logincomponent to theinitializeVaultFromBackupmethod inEngineService. It used to live in theLogincomponent since we needed to ensure that existing user was set to true so that users would not re-encounter the vault recovery flow when backgrounding/re-opening post vault recovery. However, it does not need to belong in the component if vault recovery relies oninitializeVaultFromBackup, which is where we've moved the set existing user call.Changelog
CHANGELOG entry:
Related issues
Fixes: Part of https://consensyssoftware.atlassian.net/browse/MCWP-240
Manual testing steps
Screenshots/Recordings
Before
After
Existing user is set to true on vault recovery
https://github.com/user-attachments/assets/a1cb3040-4545-44f3-8472-74b280644e41
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Shifts responsibility for marking returning users to the engine layer during vault recovery.
existingUservia Redux inEngineService.initializeVaultFromBackupafter successful re-init; adds test asserting dispatch ofsetExistingUser(true)setExistingUserusage andisVaultRecoverylogic fromLogin(nouseDispatch; route params/type cleaned up)WalletRestoredto navigate toRoutes.ONBOARDING.LOGINwithout{ isVaultRecovery }; adjusts related testsLogintests by removing mocks and cases tied to vault recovery flagWritten by Cursor Bugbot for commit 97b1a1a. This will update automatically on new commits. Configure here.