Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Onboarding failing biometrics locks screen for user instead of d…
…isabling biometrics and continuing with the onboarding (#12120) ## **Description** During the course of onboarding, if the user enables Face ID to log in to the app, but the Face ID is unsuccessful in reading the users face, or the user cancels the Face ID check, the user is then locked out of the app and kicked out of the onboarding flow. When they sign back in they are taken to the wallet screen. I have added a fix so that if the Face ID fails or the user cancels the Face ID check, Face ID will be disabled and the user will have to log in with their password. The onboarding process will also continue without locking the user out of the app. The fix isn't 'ideal' as we use a `catch` block to catch an error and then perform some state setting, when ideally a `catch` should be used exclusively for error handling. However, when Biometrics fail, React Native throws an error that ends up in the `catch`. I also would prefer an `enum` to be used but we are in a JS file instead of a TS file. To test the issue repeat the following: 1. Install the app on device. 2. Start the onboarding and enter a new password. 3. Enable Face ID (iOS) and cover the camera so the Face ID fails. 4. Then hit cancel, or repeat the process and hit cancel when the second alert appears. 5. You should then be pushed through to the next onboarding screen and you should not be sent back to the lock screen and be asked to log in again. ## **Related issues** Fixes: https://github.com/orgs/MetaMask/projects/60/views/16?pane=issue&itemId=84422135&issue=MetaMask%7Cmetamask-mobile%7C11964 ## **Manual testing steps** 1. Install the app on device. 2. Start the onboarding and enter a new password. 3. Enable Face ID (iOS) and cover the camera so the Face ID fails. 4. Then hit cancel, or repeat the process and hit cancel when the second alert appears. 5. You should then be pushed through to the next onboarding screen and you should not be sent back to the lock screen and be asked to log in again. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/39dc4b1f-3099-433f-ac7b-4aff9e6ca742 ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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.
- Loading branch information