fix: add GoogleLoginNoProviderDependencies error handling with browser fallback#26677
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. |
tylerc-consensys
left a comment
There was a problem hiding this comment.
some of the tests are duplicates from app/core/OAuthService/OAuthLoginHandlers/index.test.ts , can delete those
duplicate tests removed. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The changes are isolated to:
This does NOT affect:
The E2E test tags available don't have specific coverage for OAuth/seedless onboarding flows. The closest would be SmokeIdentity (for sync features) or SmokeWalletPlatform (for wallet lifecycle), but these changes are specifically about error handling in the OAuth login path, which is an edge case scenario that wouldn't be covered by standard E2E tests anyway. Since this is a defensive error handling improvement with good unit test coverage, and the E2E tests don't specifically cover OAuth login edge cases, no E2E tags are needed. Performance Test Selection: |
Description
Users on certain Android devices (particularly those without Google Play Services or with missing credential provider dependencies) were encountering crashes during Google OAuth login. The Android Credential Manager throws an error with the message "no provider dependencies found" when it cannot locate the required credential providers.
This was tracked in Sentry: https://metamask.sentry.io/issues/7217935136/
Solution:
Added a new OAuthErrorType.GoogleLoginNoProviderDependencies error type to handle this specific failure
Added regex pattern detection in AndroidGoogleLoginHandler to identify the "no provider dependencies found" error
Extended the browser OAuth fallback logic in the Onboarding screen to include this error type, allowing affected users to complete authentication via browser-based OAuth instead of showing an error
Changelog
CHANGELOG entry: Fixed Google login crash on Android devices without credential provider dependencies by falling back to browser-based authentication
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TO-563
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches Google OAuth error classification and onboarding fallback behavior on Android, which can affect login flow and error handling paths. Scope is small and covered by new unit tests, but regressions could block sign-in on affected devices.
Overview
Prevents Android Google social login crashes when the Android Credential Manager reports missing provider dependencies by introducing
OAuthErrorType.GoogleLoginNoProviderDependenciesand mapping the ACM error message to it inAndroidGoogleLoginHandler.Extends Onboarding’s Android Google browser OAuth fallback to trigger for this new error type, and adds/updates Jest coverage to verify the new error mapping and that fallback is attempted when this condition occurs.
Written by Cursor Bugbot for commit 71f4ea4. Configure here.