metamask-mobile
metamask-mobile copied to clipboard
fix: Apply major `ComposableController` API updates that fix broken functionality
Description
This commit updates the @metamask/composable-controller to the upcoming release 8.0.0.
This involves fixing bugs outlined in https://github.com/MetaMask/metamask-mobile/issues/10073, and applying the major changes to the ComposableController API that has accumulated between the intervening versions.
TODO:
- Write tests verifying that populated
this.datamodel.statehas the same structure asEngineStateat runtime. - Verify that discrepancy between
ComposableControllergeneric params doesn't cause issues. - Explore possibility of testing that a controller is subscribed to certain events.
Changelog
Changed
- BREAKING: Instantiate
ComposableControllerclass constructor optionmessengerwith aRestrictedControllerMessengerinstance derived from thecontrollerMessengerclass field instance ofEngine, instead of passing in thecontrollerMessengerinstance directly (#10441)- BREAKING: Narrow external actions allowlist from
GlobalActions['type']to an empty union. - BREAKING: Narrow external events allowlist from
GlobalEvents['type']to a union of thestateChangeevents of all controllers included in theEngineStatetype.
- BREAKING: Narrow external actions allowlist from
- BREAKING: Bump
@metamask/composable-controllerfrom^3.0.0to^8.0.0(#10441) - BREAKING: Convert the
EngineStateinterface to use type alias syntax to ensure compatibility with types used in MetaMask controllers (#10441)
Fixed
- BREAKING: Narrow
Engineclassdatamodelclass field fromanytoComposableController<EngineState, Controllers[keyof Controllers]>(#10441) ComposableControllercan be instantiated with any collection of child controller instances regardless of theBaseControllerpackage version they inherit from (#10441)- Fix type errors caused by child controllers inheriting from outdated
BaseControllerV1versions. - Restore previously suppressed type-level validation for
controllersconstructor option.
- Fix type errors caused by child controllers inheriting from outdated
- The
Engineclassstategetter method now normalizesnullinto 0 for theconversionRatevalues of all native currencies keyed in thecurrencyRatesobject ofCurrencyRatesControllerState(#10441)
Related issues
- Closes https://github.com/MetaMask/metamask-mobile/issues/10073
- Applies https://github.com/MetaMask/core/pull/4467/
- Blocked by
@metamask/[email protected]release.
- Blocked by
- Supersedes https://github.com/MetaMask/metamask-mobile/pull/10011
Manual testing steps
Screenshots/Recordings
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
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using JSDoc format if applicable
- [x] 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.
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
| Package | New capabilities | Transitives | Size | Publisher |
|---|---|---|---|---|
| npm/@metamask/[email protected] | None | 0 |
70.3 kB | metamaskbot |
🚮 Removed packages: npm/@metamask/[email protected]
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 179ff4fb79369862698979bb713e4b50e19d4fe1 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/82aa3b81-4cfc-40b0-a586-446d926d865b
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄
Commit hash: 1f02b8aa79c8d28b7f05e73e8f8c1a1a14761f00 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/02252d60-0f2f-4708-8e2c-015784e7e5ef
[!NOTE]
- This comment will auto-update when build completes
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: ef79728ea188a36304f98b7d5ef395388a9caed3 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/3f5559cd-123f-49bd-90ee-d24c923d0bea
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 0b70f895fac432ea059074c1d7f7b688cb9f71e7 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/66686bcd-c69a-4382-9c5a-f7be2f3fc9e4
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎
This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 545abec12d01cb2e2dfcaebc57684faad5034201 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/cea98bd8-42f0-4c63-b5b1-b281326b541b
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 6e69e1c1a8ee54d2b2de87793d0e51801d661187 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/09cc3295-5fb4-4a74-9d02-ba50593b9729
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 39bcf98298c1b9a8449fc15403e46c0f00b1a988 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/94141b1f-b0a5-44f0-9b54-f58c22e31472
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 9aa4d23ea4231cbaa49bedfbac36a6970d0f302b Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/7363f6b0-a21a-4e3a-9f62-6e5151aa1603
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄
Commit hash: 3d7f48fd697cdc74bb05adcc62f1da4faf2715ac Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/10cd648c-60a2-4d3e-8d9f-eebe47bb763f
[!NOTE]
- This comment will auto-update when build completes
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 1e7f6a4fa28fc66f9ce4605016956f3b536408ae Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/fd44952f-7e5a-4514-b326-f4cb5ef7ddb9
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: c8758b31a96316c7add21f391b765922b016d4d9 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/b59ca851-faa7-4bcc-9711-1df3230a4751
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Codecov Report
Attention: Patch coverage is 60.00000% with 12 lines in your changes missing coverage. Please review.
Project coverage is 57.06%. Comparing base (
1a83b1f) to head (153e072). Report is 1 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #10441 +/- ##
=======================================
Coverage 57.05% 57.06%
=======================================
Files 1817 1818 +1
Lines 40880 40881 +1
Branches 5166 5165 -1
=======================================
+ Hits 23326 23329 +3
+ Misses 15972 15970 -2
Partials 1582 1582
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: c8d030f5c0b07163cfab28700b8e6c4379a42df5 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/70cd4197-85ef-4265-adb5-f3a3e5668923
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
[!TIP]
- Check the documentation if you have any doubts on how to understand the failure on bitrise
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: bba0f535ad095f2869a914b08af478f6fe5b9ae0 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/46cbabea-1452-4cea-be81-c716860829f6
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
[!TIP]
- Check the documentation if you have any doubts on how to understand the failure on bitrise
Quality Gate passed
Issues
15 New issues
0 Accepted issues
Measures
0 Security Hotspots
83.3% Coverage on New Code
0.0% Duplication on New Code
@MajorLift Is this PR still relevant? It looks like maybe, but it has also been open for a while I'm noticing, so I'm not sure if it needs to be updated or something.
@MajorLift Is this PR still relevant? It looks like maybe, but it has also been open for a while I'm noticing, so I'm not sure if it needs to be updated or something.
Yes still relevant I am taking over this work
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: fe66a38974b063587655980c3013bae3ac35548d Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ebfbbc58-1f83-4239-8a71-224f9a3645bc
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
[!TIP]
- Check the documentation if you have any doubts on how to understand the failure on bitrise
Bitrise
🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄
Commit hash: 49f4ae09341a4d52f9b0e854b7fcea8b5af1bd63 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/73593585-1c9f-4513-a048-8acd6ae4284e
[!NOTE]
- This comment will auto-update when build completes
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄
Commit hash: 24d9936b24f4e805a25bb3fde81f8283af053ca1 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f0a01847-8e29-401d-97fe-52a8bd283ba7
[!NOTE]
- This comment will auto-update when build completes
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: eaf1ee285f0f17c41b48402bfda5cabb3fe62a38 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/005c893f-9abe-40dd-9801-d057e62e8b0a
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
[!TIP]
- Check the documentation if you have any doubts on how to understand the failure on bitrise
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 3af972a8641c971399e2eb562a3ff0cf4f388c2d Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/05ec59d2-e2ac-4fec-84d1-0dec45ff184b
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
[!TIP]
- Check the documentation if you have any doubts on how to understand the failure on bitrise
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 74fd0c55aceebadfffc77e1396c1db23b9281f41 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/0bcb4638-fcc4-48c6-bdac-79f742cd7dfd
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
[!TIP]
- Check the documentation if you have any doubts on how to understand the failure on bitrise
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 9eab5bee454a99d414862e883e8cc3e209a1dc21 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c44479ac-1a0f-414a-9f4a-f8a001069360
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
[!TIP]
- Check the documentation if you have any doubts on how to understand the failure on bitrise
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 65d978c17f87cf65366d09c95e4681c2b93cfa0a Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/fcccbcca-7b0d-4654-8257-5104f73d57ee
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
[!TIP]
- Check the documentation if you have any doubts on how to understand the failure on bitrise
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 3c014403ad5d82345277622cbafdf8d37acbaf77 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/eed2ea2a-7910-4dc7-adf0-bd1b4f307f2c
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
[!TIP]
- Check the documentation if you have any doubts on how to understand the failure on bitrise
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: e4da24ee724aecf89de820c58695aeafb8ce7016 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/27062cfc-54c6-4467-91a4-f1e046f2a979
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
[!TIP]
- Check the documentation if you have any doubts on how to understand the failure on bitrise