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

Handle Engine does not exist failures as a result of failed controller initialization #12435

Closed
9 tasks
Cal-L opened this issue Nov 26, 2024 · 0 comments · Fixed by #12538
Closed
9 tasks

Handle Engine does not exist failures as a result of failed controller initialization #12435

Cal-L opened this issue Nov 26, 2024 · 0 comments · Fixed by #12538
Assignees
Labels
release-7.38.0 Issue or pull request that will be included in release 7.38.0 team-mobile-platform Mobile Platform team

Comments

@Cal-L
Copy link
Contributor

Cal-L commented Nov 26, 2024

What is this about?

This task is intended to handle the condition where users encounter the error Engine does not exist failures as a result of failed controller initialization.

Scenario

No response

Design

No response

Technical Details

  • Direct user to wallet recovery flow if engine initialization fails to prevent user from being bricked

Threat Modeling Framework

No response

Acceptance Criteria

  • Only user experience change should be that users are redirect to the wallet recovery flow if engine initialization fails. This can be reproduced by setting the AccountController's selectedAccount to undefined

Stakeholder review needed before the work gets merged

  • Engineering (needed in most cases)
  • Design
  • Product
  • QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
  • Security
  • Legal
  • Marketing
  • Management (please specify)
  • Other (please specify)

References

No response

@Cal-L Cal-L added the team-mobile-platform Mobile Platform team label Nov 26, 2024
@Cal-L Cal-L self-assigned this Nov 26, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 9, 2024
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

The main purpose of these changes is to ensure that the navigation
service is available when Engine is initialized. The reason that this is
needed is because it allows us to redirect instances of failed
controller instances to vault recovery where users may at least recover
their keys as opposed to being bricked. This is an example of the
bricked state - #12115.

This PR reorganizes the initialization of services, including Engine to
sagas, where it enables us to wait for dependencies to load first. The
two dependencies that the Engine relies on are:
- Persisted data loaded
- Navigation loaded

## **Related issues**

Fixes: #12435

## **Manual testing steps**

While the underlying logic changes, the app behavior should remain the
same

1. Install the app on this branch
2. Create a wallet
3. Kill app, reopen and login
4. Should not experience any issues

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->
Simulates controller failed initialization


https://github.com/user-attachments/assets/beb5e952-0fe3-4470-8aa6-2ff0947e3ffd

### **After**

<!-- [screenshots/recordings] -->

Simulates vault recovery when controller fails to initialize

https://github.com/user-attachments/assets/76a853cd-34bc-465c-af03-d5c07609b8ee


## **Pre-merge author checklist**

- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] 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.
@metamaskbot metamaskbot added the release-7.38.0 Issue or pull request that will be included in release 7.38.0 label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-7.38.0 Issue or pull request that will be included in release 7.38.0 team-mobile-platform Mobile Platform team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants