Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DX-2615] fix: android custom tabs dismiss callback #63

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

nattb8
Copy link
Collaborator

@nattb8 nattb8 commented Jan 25, 2024

Summary

Context

  1. Sometimes, Android dismisses Chrome Custom Tabs before deeplink is triggered. When Chrome Custom Tabs is dismissed, HandleOnLoginPKCEDismissed is called.
  2. There are two parts to the PKCE flow
    i. Log into Passport in Chrome Custom Tabs. On success, deeplink the user back into the game.
    ii. After deeplink is called, complete the PKCE login flow. On success, the PKCE login is complete.

Issue 1

Currently, HandleOnLoginPKCEDismissed checks if the SDK is currently trying to connect (using IPS_CONNECTING) and if it is, it will nullify PKCEResponseDelegate. This is not the right way to check, as IPS_CONNECTING is set when PKCE flow starts (point 2i), so if Custom Tabs is dismissed after the second part of PKCE login flow starts (point 2ii) but before it finishes, the PKCEResponseDelegate will no longer be there to call once PKCE login completes.

To fix this issue, IPS_PKCE_COMPLETING is added to indicate when the second part of the PKCE flow starts. If Chrome Custom Tabs is dismissed before the second part, it may nullify the PKCEResponseDelegate.

Issue 2

IPS_CONNECTED is set once the second part of the PKCE flow starts (2ii). This should not be set until OnConnectPKCEResponse is successful.

Customer Impact

Android PKCE flow may not work on some Android devices.

Other things to consider:

  • Prefix your PR title with feat: , fix: , chore: , docs: , refactor: or test: .
  • N/A Samp e blueprints are updated with new SDK changes
  • N/A Updated public documentation with new SDK changes (Immutable X and Immutable zkEVM)
  • N/A Replied to GitHub issues

@nattb8 nattb8 requested a review from a team as a code owner January 25, 2024 21:18
@nattb8 nattb8 merged commit 9b6276d into main Jan 25, 2024
8 checks passed
@nattb8 nattb8 deleted the fix/android-custom-tabs-dismissed branch January 25, 2024 21:48
@github-actions github-actions bot added the fix label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants