chore: Move auth logic from App.tsx to sagas and use unlockWallet#24539
chore: Move auth logic from App.tsx to sagas and use unlockWallet#24539
unlockWallet#24539Conversation
…/6008-abstract-auth-api-cal
…rors are encountered
…tor/MCWP-240-login-screen
…tor/MCWP-240-login-screen
…tor/MCWP-240-login-screen
…tor/MCWP-239-App.tsx
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24539 +/- ##
==========================================
- Coverage 79.88% 79.88% -0.01%
==========================================
Files 4231 4244 +13
Lines 108283 109055 +772
Branches 22674 22803 +129
==========================================
+ Hits 86503 87118 +615
- Misses 15722 15887 +165
+ Partials 6058 6050 -8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThe PR refactors the authentication flow from the App component to Redux sagas. Key changes include:
The changes are well-tested with unit tests (sagas.test.ts), but E2E testing is important to verify:
Selected tags:
The risk is medium because:
|
|




Description
This PR continues to consolidate app unlock logic. This time, we're removing the auth trigger from
App.tsxand moving the responsibility to sagas. We're also leveraging the newunlockWalletmethod to provide a more robust and predictable user experience. Furthermore, we've moved MetaMetrics initialization in the scope of service initialization in the sagas. This ensures that the service is initialized before an authentication attempt is made.Changelog
CHANGELOG entry:
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-239
Manual testing steps
This change is experienced on cold starts.
Navigates to Login screen if biometrics is not enabled
Automatically prompts biometrics if biometrics is enabled
Navigates to Login screen if biometrics fails
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Centralizes startup auth and telemetry in sagas for more predictable app initialization.
requestAuthOnAppStartsaga to callAuthentication.unlockWallet; on failure, resets toRoutes.ONBOARDING.LOGINstartAppServices, waits one frame to avoid navigation race, and keepsapplyVaultInitializationApp.tsx(retains version migration and seedless password check); drops unused hooks/importsApp.test.tsxto focus on multichain account routes/screensWritten by Cursor Bugbot for commit 0271e88. This will update automatically on new commits. Configure here.