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

Fix: deeplinks handling when lock method is enabled #1034

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

Gamboster
Copy link
Collaborator

@Gamboster Gamboster commented Jan 22, 2024

How to reproduce the error:

iOS:
Enable the PIN/Biometric lock method:

  • If the app is closed (Not in the background) and you click on a deeplink: There is a race between the lock modal and the navigation to the destination page. If the modal is showed before the navigation, then the app crashes and needs to restart.

Proposed solution: Wait for the lock modal to be successfully dismissed before performing the navigation.

  • If the app is in the background there are 3 possible cases to take into account:
  1. It has been minimized more than 20 seconds ago since the last unlock (lockAuthorizedUntil). So when you click on a deeplink, you return to the app, it shows the lock modal and a case similar to the previous one happens, in which a race occurs between the lock modal and the link navigation.

  2. It has been minimized after the selected lock method has been successfully dismissed, and the deeplink has been clicked within 20 seconds (lockAuthorizedUntil), so the lock modal should not be displayed and only navigation should be performed.

  3. The app has been minimized with the lock modal already open. In this case the lock modal should continue to be shown and wait for it to be correctly dismissed to continue with the link

Proposed solution: Control the lockAuthorizedUntil variable, to verify whether the time has been met or not. If the time is not met, the deeplink navigation is carried out normally. If the time has already passed or the modal was previously open, wait for the lock modal to be successfully dismissed before performing the navigation.

Android:
After some testing, it seems to work correctly, so no changes are necessary here.

Copy link
Member

@cmgustavo cmgustavo left a comment

Choose a reason for hiding this comment

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

ACK! 👍🏼

@JohnathanWhite JohnathanWhite merged commit 84d4a2b into bitpay:master Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants