Skip to content

Integrate PollingController mixin with GasFeeController - #1673

Merged
adonesky1 merged 7 commits into
mainfrom
networkclientid-polling
Sep 29, 2023
Merged

Integrate PollingController mixin with GasFeeController#1673
adonesky1 merged 7 commits into
mainfrom
networkclientid-polling

Conversation

@adonesky1

@adonesky1adonesky1 commented Sep 13, 2023

Copy link
Copy Markdown
Contributor

Integrates recently introduced PollingController mixin with GasFeeController. Leaves old polling pattern in pace for now so as to not force a ton of breaking changes for mobile, but with intention to activate new pattern in both clients ASAP.

Addresses: https://github.com/MetaMask/MetaMask-planning/issues/1314

Comment threadpackages/gas-fee-controller/src/GasFeeControllerPolling.ts Outdated
Comment threadpackages/gas-fee-controller/src/GasFeeControllerPolling.ts Outdated
Comment threadpackages/gas-fee-controller/src/GasFeeControllerPolling.ts Outdated
Comment threadpackages/gas-fee-controller/src/GasFeeControllerPolling.ts Outdated
Comment threadpackages/gas-fee-controller/src/GasFeeControllerPolling.ts Outdated
@shanejonas
shanejonasforce-pushed the networkclientid-polling branch from 900c3d5 to 9fa253aCompareSeptember 15, 2023 20:10
@adonesky1
adonesky1force-pushed the networkclientid-polling branch from e936134 to 1844af4CompareSeptember 18, 2023 16:29
@adonesky1
adonesky1 marked this pull request as ready for review September 18, 2023 16:46
@adonesky1
adonesky1 requested a review from a team as a code ownerSeptember 18, 2023 16:46
@Gudahtt

Copy link
Copy Markdown
Member

Generally this looks good! Will give it a more detailed review later

@adonesky1
adonesky1force-pushed the networkclientid-polling branch 4 times, most recently from 0ef971b to 41ccfc8CompareSeptember 20, 2023 02:15
Comment threadpackages/controller-utils/package.json Outdated
Comment threadpackages/controller-utils/package.json Outdated
@shanejonas
shanejonasforce-pushed the networkclientid-polling branch from 290ac3b to 20199c3CompareSeptember 21, 2023 19:52
@socket-security

socket-securityBot commented Sep 21, 2023

Copy link
Copy Markdown

👍 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.

@Gudahtt

Copy link
Copy Markdown
Member

I suspect that CI will not let us use the new package in the gas fee controller package until we merge and release it separately

@GudahttGudahtt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great! Maybe we can move the new package into a separate PR and get that merged and released to unblock the gas fee controller changes.

Comment threadpackages/polling-controller/src/PollingController.test.ts Outdated
Comment threadpackages/polling-controller/src/PollingController.ts Outdated
Comment threadpackages/polling-controller/src/PollingController.ts Outdated
Comment threadpackages/polling-controller/src/PollingController.ts Outdated
Comment threadpackages/polling-controller/src/PollingController.ts Outdated
@shanejonasshanejonas mentioned this pull request Sep 22, 2023
shanejonas added a commit that referenced this pull request Sep 26, 2023
## Explanation
> Originally was in #1673 but
pulled out to get this in on its own.
Adds an abstract class (currently named `PollingController`. The start
and stop methods are parameterized by `networkClientId`'s and
`pollingToken`'s and polling intervals are stored in class variables by
`chainId` so that multiple `networkClients`/`chainIds` can poll
simultaneously. `executePoll` is an abstract method to be implemented by
the controller itself so that this pattern could be generalized and be
agnostic to what is being executed on the polling interval.
## References
Related to #1673
Related to https://github.com/MetaMask/MetaMask-planning/issues/1314
---------
Co-authored-by: Alex Donesky <adonesky@gmail.com>
@shanejonas
shanejonasforce-pushed the networkclientid-polling branch from 7bb1699 to 9bd377bCompareSeptember 26, 2023 14:47
Comment threadpackages/gas-fee-controller/src/GasFeeController.ts Outdated
Comment threadpackages/gas-fee-controller/src/GasFeeController.ts Outdated
@adonesky1adonesky1 changed the title Integrate PollingController Mixing with GasFeeControllerIntegrate PollingController mixin with GasFeeControllerSep 28, 2023
Comment threadpackages/gas-fee-controller/src/GasFeeController.ts Outdated
jiexi
jiexi previously approved these changes Sep 28, 2023
Comment threadpackages/network-controller/src/NetworkController.ts Outdated
@adonesky1
adonesky1force-pushed the networkclientid-polling branch from 283b09b to 20e9ea3CompareSeptember 28, 2023 19:50
@adonesky1
adonesky1 merged commit fd03dc6 into mainSep 29, 2023
@adonesky1
adonesky1 deleted the networkclientid-polling branch September 29, 2023 15:30
@legobeat

Copy link
Copy Markdown
Contributor

adonesky1 added a commit that referenced this pull request Oct 2, 2023
)
## Explanation
Adds missing dependency introduced in #1673
## References
- Follow-up to: #1673 ## Changelog
## Checklist
- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
---------
Co-authored-by: Alex <adonesky@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@adonesky1@Gudahtt@jiexi@legobeat@shanejonas@BelfordZ