metamask-mobile
metamask-mobile copied to clipboard
fix(deps): bump `@metamask/composable-controller` from `^3.0.0` to `^6.0.2`
Description
-
Applies
ComposableControllerAPI changes introduced to the controller in the following series of PRs:- https://github.com/MetaMask/core/pull/3590 (
v5.0.0) - https://github.com/MetaMask/core/pull/3904 (
v6.0.0) - https://github.com/MetaMask/core/pull/3964 (
v6.0.0) - https://github.com/MetaMask/core/pull/3952 (
v6.0.2)
- https://github.com/MetaMask/core/pull/3590 (
-
Provides hotfix for type error caused by mismatch between the
ControllerInstancegeneric constraint to theChildControllersgeneric parameter of theComposableControllerclass.- As long as we're confident about the accuracy of the
Controllerstype, it should be safe to apply this@ts-expect-error, since we're overloading theChildControllersgeneric parameter with known information about the input child controllers (Controllers[keyof Controllers]).
- As long as we're confident about the accuracy of the
Required follow-up changes
-
ComposableController:- The
BaseControllerV1Instancetype needs to be fixed to accommodate controller versions used in mobile that inherit fromBaseControllerV1.
Type 'PhishingController | AccountsController | AccountTrackerController | AddressBookController | ... 22 more ... | SwapsController' does not satisfy the constraint 'ControllerInstance'. Type 'AccountTrackerController' is not assignable to type 'ControllerInstance'. Type 'AccountTrackerController' is not assignable to type 'BaseControllerV1Instance'. Types have separate declarations of a private property 'initialConfig'.ts(2344)- Add jsdoc for the
ChildControllersoptional generic parameter, making it clearer that a full list of controllers can be supplied by the consumer. - Fix
LegacyComposableControllerStateConstraintto{ [name: string]: Record<any, any> }, since index signature ofinterfacetypes used for V1 state objects is not fixed tostring. - Test on mobile engine whether runtime checks
isBaseController()andisBaseControllerV1()are functioning as intended.
- The
-
On mobile, upgrade the affected controllers to V2:
- V2 upgrades are available for all of the following:
-
AccountTrackerController -
NftController -
TokenRatesController -
TransactionController
-
- Exceptions:
-
AssetsContractController: set to be upgraded to non-controller that uses messenger but doesn't inherit fromBaseControllerV2.ComposableControllerwill need to be updated to accommodated non-controllers -
NftDetectionController: current release inherits fromBaseControllerV2, but should be upgraded to non-controller. -
SwapsController: V2 upgrade unavailable
-
- V2 upgrades are available for all of the following:
Related issues
- Resolves issues found in @kylanhurt's branch: https://github.com/MetaMask/metamask-mobile/compare/main...kylan/composable-controller
- Blocked by https://github.com/metamask/metamask-mobile/10073
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
- [x] I’ve followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards.
- [x] 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 format if applicable
- [ ] I’ve applied the right labels on the PR (see labeling guidelines). 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.
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.
Superseded by:
- https://github.com/MetaMask/core/pull/4467/
- https://github.com/MetaMask/metamask-mobile/pull/10374