Skip to content

feat: Update network controller to version 13.0.1#9065

Merged
tommasini merged 31 commits intomainfrom
feat/1629-update-network-controller-v13-0-1
Apr 10, 2024
Merged

feat: Update network controller to version 13.0.1#9065
tommasini merged 31 commits intomainfrom
feat/1629-update-network-controller-v13-0-1

Conversation

@tommasini
Copy link
Copy Markdown
Contributor

@tommasini tommasini commented Mar 26, 2024

Description

Updated network controller to version 13.0.1. Also created migration to delete networkId property from the network controller state
Added an inpageProvider property with a network id property to our internal property,
Created the reducer and the action for that property with createSlice of redux toolkit
Added dispatch to the engine event subscriber networkdStateChange to update networkId
Added dispatch to the Engine file with subscribing an event networkWillChange to update networkId to "loading"
Updated the patch of network controller
Updated test cases and initial states with new data structure with the networkId property

Related issues

Fixes https://github.com/MetaMask/mobile-planning/issues/1624

Manual testing steps

QA Build: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/4b1752b4-2490-4eee-b0f9-68a347562ccd

  1. Go to this page...

Screenshots/Recordings

Screen.Recording.2024-03-27.at.11.26.55.mov

Latest recording with new actions (while updating migration from main with account imported on optimism)

Screen.Recording.2024-03-28.at.13.09.59.mov

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • 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.

…o delete networkId property from the network controller state and added a network id property to our own internal property, created the reducer and the action for that property and added the dispatch to the engine event subscriber, update the patch of network controller, updated test cases and initial states with new data structure with the networkId property
@tommasini tommasini added the team-mobile-platform Mobile Platform team label Mar 26, 2024
@github-actions
Copy link
Copy Markdown
Contributor

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.

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 26, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/network-controller@13.0.1 environment Transitive: filesystem, network +29 4.69 MB metamaskbot

View full report↗︎

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 27, 2024

Codecov Report

Attention: Patch coverage is 76.47059% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 45.42%. Comparing base (3f17ad2) to head (01c34ae).

Files Patch % Lines
app/core/Engine.ts 28.57% 5 Missing ⚠️
app/components/Views/Asset/index.js 0.00% 4 Missing ⚠️
app/core/BackgroundBridge/BackgroundBridge.js 20.00% 4 Missing ⚠️
app/components/Views/TransactionsView/index.js 0.00% 2 Missing ⚠️
app/core/SDKConnect/AndroidSDK/AndroidService.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9065      +/-   ##
==========================================
+ Coverage   45.35%   45.42%   +0.07%     
==========================================
  Files        1272     1274       +2     
  Lines       31247    31300      +53     
  Branches     3189     3192       +3     
==========================================
+ Hits        14171    14218      +47     
- Misses      16234    16241       +7     
+ Partials      842      841       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tommasini tommasini changed the title feat: Update network controller to version 13.0.1. Also created migration t… feat: Update network controller to version 13.0.1 Mar 27, 2024
@tommasini tommasini marked this pull request as ready for review March 27, 2024 11:58
@tommasini tommasini requested a review from a team March 27, 2024 11:58
@tommasini tommasini requested a review from a team as a code owner March 27, 2024 11:58
@tommasini tommasini added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) Run Smoke E2E labels Mar 27, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: e2b926e
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/b7c5502f-15b1-4ead-9503-ff5db8a7cf69

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

omridan159
omridan159 previously approved these changes Mar 27, 2024
andreahaku
andreahaku previously approved these changes Mar 27, 2024
Copy link
Copy Markdown
Contributor

@andreahaku andreahaku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Gudahtt
Copy link
Copy Markdown
Member

Gudahtt commented Mar 27, 2024

Great work! Mostly looks good, I left some comments/suggestions but the only real concern is what I asked about in this comment, as it may introduce a race condition where the networkId is sometimes incorrect.

@christopherferreira9
Copy link
Copy Markdown
Contributor

All good for SDK

…only look for network id when the network did change
@tommasini tommasini dismissed stale reviews from andreahaku and omridan159 via b9ae3c4 March 27, 2024 19:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 6210b09
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/236b9162-7a29-4a7b-85cf-d6e5b23d50b4

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

…ion we do not need to ensure was being called with the right argument, we have separate unit tests for that function
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 6f53c81
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/9902e2bb-d417-4cab-ad64-5d91662a3976

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 0f6b255
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ac46fea1-8450-4a5a-8aa8-5ebf66f716ac

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

NicolasMassart
NicolasMassart previously approved these changes Apr 9, 2024
Copy link
Copy Markdown
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@tommasini
Copy link
Copy Markdown
Contributor Author

Uprade path from version 7.19.0 with networks imported

Screen.Recording.2024-04-09.at.19.32.43.mov

… fresh install the networkId would not be updated because the event network did change did not trigger
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 1c840b5
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/958c4b6e-858f-43bc-8ce7-2783d97e85d7

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: a1981d7
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8d7440ac-1e21-4ee0-81ba-9344315431f0

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@sonarqubecloud
Copy link
Copy Markdown

@christopherferreira9
Copy link
Copy Markdown
Contributor

all good with the sdk now 💪

Copy link
Copy Markdown
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@tommasini tommasini merged commit 4f830c8 into main Apr 10, 2024
@tommasini tommasini deleted the feat/1629-update-network-controller-v13-0-1 branch April 10, 2024 17:08
@github-actions github-actions bot locked and limited conversation to collaborators Apr 10, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Apr 10, 2024
@metamaskbot metamaskbot added the release-7.21.0 Issue or pull request that will be included in release 7.21.0 label Apr 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.21.0 Issue or pull request that will be included in release 7.21.0 team-mobile-platform Mobile Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

9 participants