Skip to content

fix: add GoogleLoginNoProviderDependencies error handling with browser fallback#26677

Merged
grvgoel81 merged 4 commits into
mainfrom
fix/oauth-provider-dependencies-error
Mar 2, 2026
Merged

fix: add GoogleLoginNoProviderDependencies error handling with browser fallback#26677
grvgoel81 merged 4 commits into
mainfrom
fix/oauth-provider-dependencies-error

Conversation

@grvgoel81

@grvgoel81 grvgoel81 commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

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

Feature: Google OAuth Android Fallback

  Scenario: user completes Google login on device without credential provider
    Given user is on the Onboarding screen on an Android device
    And the device does not have Google Play Services or credential provider configured

    When user taps "Continue with Google"
    Then the app should fall back to browser-based Google OAuth
    And user should be able to complete authentication through the browser
    And user should be redirected back to the app successfully

  Scenario: user completes Google login on device with credential provider
    Given user is on the Onboarding screen on an Android device
    And the device has Google Play Services configured

    When user taps "Continue with Google"
    Then the Android Credential Manager One Tap UI should appear
    And user should be able to complete authentication normally

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

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.GoogleLoginNoProviderDependencies and mapping the ACM error message to it in AndroidGoogleLoginHandler.

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.

@github-actions

Copy link
Copy Markdown
Contributor

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.

@grvgoel81 grvgoel81 added the team-onboarding Onboarding team label Feb 27, 2026
@grvgoel81 grvgoel81 marked this pull request as ready for review March 2, 2026 06:01
@grvgoel81 grvgoel81 requested a review from a team as a code owner March 2, 2026 06:01

@tylerc-consensys tylerc-consensys left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of the tests are duplicates from app/core/OAuthService/OAuthLoginHandlers/index.test.ts , can delete those

@grvgoel81

Copy link
Copy Markdown
Contributor Author

some of the tests are duplicates from app/core/OAuthService/OAuthLoginHandlers/index.test.ts , can delete those

duplicate tests removed.

@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes add a new OAuth error type (GoogleLoginNoProviderDependencies) and handling for cases where the Android Credential Manager cannot find required provider dependencies (e.g., missing Google Play Services). This is a targeted error handling improvement that:

  1. Adds a new error code to the OAuthErrorType enum
  2. Adds regex pattern matching for the specific error message in the Android Google login handler
  3. Updates the Onboarding component to fall back to browser-based OAuth when this error occurs
  4. Includes comprehensive unit tests for the new functionality

The changes are isolated to:

  • OAuth service error handling (app/core/OAuthService/)
  • Onboarding view's OAuth error handling (app/components/Views/Onboarding/)

This does NOT affect:

  • Standard wallet creation flow (non-OAuth)
  • SRP import flow
  • Transaction confirmations
  • Network management
  • Any other wallet features

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:
These changes are purely about error handling in the OAuth login flow. They add a new error type and fallback mechanism for edge cases where Google Play Services is unavailable. There are no changes to UI rendering, data loading, state management, or any performance-critical paths. The changes don't affect app startup, login performance, or any user-facing performance metrics.

View GitHub Actions results

@grvgoel81 grvgoel81 enabled auto-merge March 2, 2026 17:16
@grvgoel81 grvgoel81 added this pull request to the merge queue Mar 2, 2026
Merged via the queue into main with commit 837c127 Mar 2, 2026
57 checks passed
@grvgoel81 grvgoel81 deleted the fix/oauth-provider-dependencies-error branch March 2, 2026 17:38
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 2, 2026
@metamaskbot metamaskbot added the release-7.69.0 Issue or pull request that will be included in release 7.69.0 label Mar 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-onboarding release-7.69.0 Issue or pull request that will be included in release 7.69.0 size-M team-onboarding Onboarding team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants