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

Migrate OnboardingController to BaseController v2 #25927

Closed
1 of 9 tasks
mcmire opened this issue Jul 18, 2024 · 0 comments · Fixed by #26880
Closed
1 of 9 tasks

Migrate OnboardingController to BaseController v2 #25927

mcmire opened this issue Jul 18, 2024 · 0 comments · Fixed by #26880
Assignees
Labels
release-12.6.0 Issue or pull request that will be included in release 12.6.0 team-wallet-framework

Comments

@mcmire
Copy link
Contributor

mcmire commented Jul 18, 2024

What is this about?

Following the Wallet Framework team's OKRs for Q3 2024, we want to bring OnboardingController up to date with our latest controller patterns.

Scenario

No response

Design

No response

Technical Details

No response

Threat Modeling Framework

No response

Acceptance Criteria

  • A constant called controllerName exists which holds the name of the controller.
  • A constant called controllerMetadata exists which holds the metadata for the state.
  • The default state object (defaultState) is extracted to a function called getDefaultOnboardingControllerState.
  • OnboardingController inherits from BaseController.
    • The OnboardingController constructor signature is updated to take a partial state option instead of initState (which is of type Partial<Omit<OnboardingControllerState, 'onboardingTabs'>>), as well as messenger.
    • The OnboardingController constructor is updated to super to the superclass.
      • The way that default state is mixed into given state is simplified.
    • this.state is used to access state instead of this.store.getState.
    • this.update is used to update state instead of this.store.updateState.
  • Supporting types exist.
    • The OnboardingControllerState type exists and represents the current shape of the state object.
    • The OnboardingControllerGetStateAction and OnboardingControllerStateChangeEvent types exist.
    • The AllowedActions and AllowedEvents types exist.
    • The OnboardingControllerMessenger type exists and expects no actions or events to be allowed.
    • OnboardingControllerState exists and represents the current shape of the state object.
  • The tests are updated to follow suit.
    • onboardingController.state is used to access state instead of onboardingController.store.getState().
    • onboardingController.store.updateState is not mocked, as this is no longer possible.
    • Instead of using beforeEach to initialize the controller in each test, a setupController function exists and is called in each test.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-12.6.0 Issue or pull request that will be included in release 12.6.0 team-wallet-framework
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants