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

chore: bump asset controllers to 39 + polling API #28025

Merged
merged 12 commits into from
Oct 29, 2024

Conversation

bergeron
Copy link
Contributor

@bergeron bergeron commented Oct 22, 2024

Description

Bumps the asset controllers to 39. In this version, the polling API has changed from startPollingByNetworkClientId to a more flexible startPolling that can accept any input. The usePolling hook is modified to accommodate this.

Open in GitHub Codespaces

Related issues

Manual testing steps

Should be no noticeable changes. Currency rates should continue to be fetched. Try switching between chains with different native currencies like mainnet, polygon, bnb and verify the native token has fiat prices.

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

Copy link
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.

Copy link

socket-security bot commented Oct 22, 2024

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

Package New capabilities Transitives Size Publisher
npm/@metamask/controller-utils@11.4.0 network 0 263 kB metamaskbot

🚮 Removed packages: npm/@metamask/controller-utils@11.3.0

View full report↗︎

@bergeron
Copy link
Contributor Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

@metamaskbot
Copy link
Collaborator

Builds ready [04ea3d6]
Page Load Metrics (1938 ± 90 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint38122781867384185
domContentLoaded16912265190417182
load17002283193818790
domInteractive16190583718
backgroundConnect9185374019
firstReactRender51208924119
getState45622199
initialActions00000
loadScripts12231730140915072
setupStore1485382512
uiStartup189127692156230111
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -34 Bytes (-0.00%)
  • ui: -38 Bytes (-0.00%)
  • common: -6.77 KiB (-0.09%)

@bergeron bergeron marked this pull request as ready for review October 23, 2024 21:52
@bergeron bergeron requested review from a team as code owners October 23, 2024 21:52
@bergeron bergeron changed the title chore: bump asset controllers to 39 chore: bump asset controllers to 39 + polling API Oct 23, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [cf66072]
Page Load Metrics (1832 ± 79 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16842400183915776
domContentLoaded16352384179015775
load16462409183216579
domInteractive14199574722
backgroundConnect11109423014
firstReactRender43122742311
getState476252311
initialActions01000
loadScripts11911917132715172
setupStore1089382411
uiStartup18282623205018488
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -34 Bytes (-0.00%)
  • ui: -38 Bytes (-0.00%)
  • common: -6.77 KiB (-0.09%)

@@ -16,9 +16,10 @@ const useCurrencyRatePolling = (networkClientId?: string) => {
const selectedNetworkClientId = useSelector(getSelectedNetworkClientId);

usePolling({
startPollingByNetworkClientId: currencyRateStartPollingByNetworkClientId,
startPolling: (input) =>
currencyRateStartPollingByNetworkClientId(input.networkClientId),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you help me understand why we aren't updating the action to also be currencyRateStartPolling?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in actions.ts i kept the function name currencyRateStartPollingByNetworkClientId to minimize changes since it does still accept a network client id (for now)

@metamaskbot
Copy link
Collaborator

Builds ready [b93a15d]
Page Load Metrics (1851 ± 57 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint25120731776367176
domContentLoaded16532026181411254
load16622082185111857
domInteractive20123452311
backgroundConnect990442813
firstReactRender50220883718
getState46217189
initialActions01000
loadScripts1193151713409948
setupStore11100422914
uiStartup18582348207313565
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -34 Bytes (-0.00%)
  • ui: -38 Bytes (-0.00%)
  • common: -6.77 KiB (-0.09%)

@metamaskbot
Copy link
Collaborator

Builds ready [b93a15d]
Page Load Metrics (1851 ± 57 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint25120731776367176
domContentLoaded16532026181411254
load16622082185111857
domInteractive20123452311
backgroundConnect990442813
firstReactRender50220883718
getState46217189
initialActions01000
loadScripts1193151713409948
setupStore11100422914
uiStartup18582348207313565
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -34 Bytes (-0.00%)
  • ui: -38 Bytes (-0.00%)
  • common: -6.77 KiB (-0.09%)

@bergeron bergeron added this pull request to the merge queue Oct 29, 2024
Merged via the queue into develop with commit acb79ec Oct 29, 2024
76 checks passed
@bergeron bergeron deleted the brian/asset-controller-39 branch October 29, 2024 16:11
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2024
@metamaskbot metamaskbot added the release-12.7.0 Issue or pull request that will be included in release 12.7.0 label Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.7.0 Issue or pull request that will be included in release 12.7.0 team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants