Skip to content

Commit 6112b2b

Browse files
authored
chore: register stopAllPolling to SubscriptionController messenger (MetaMask#9061)
## Explanation This registers the `stopAllPolling` method available in `SubscriptionController` to its messenger. ## References ## 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 communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Messenger registration and type exports only; no change to polling behavior itself. > > **Overview** > Registers the existing **`stopAllPolling`** polling API on **`SubscriptionController`** so other packages can invoke it via the messenger as **`SubscriptionController:stopAllPolling`**. > > Adds **`SubscriptionControllerStopAllPollingAction`** to the method-action types union, includes **`stopAllPolling`** in **`MESSENGER_EXPOSED_METHODS`**, exports the action type from the package entrypoint, and documents the change in the changelog. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit abee7d5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent dcf8a42 commit 6112b2b

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

packages/subscription-controller/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Expose missing `SubscriptionController:stopAllPolling` action through its messenger ([#9061](https://github.com/MetaMask/core/pull/9061))
13+
- Corresponding action type is available as well.
14+
1015
### Changed
1116

1217
- Bump `@metamask/controller-utils` from `^12.0.0` to `^12.1.1` ([#8774](https://github.com/MetaMask/core/pull/8774), [#9058](https://github.com/MetaMask/core/pull/9058))

packages/subscription-controller/src/SubscriptionController-method-action-types.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ export type SubscriptionControllerTriggerAccessTokenRefreshAction = {
227227
handler: SubscriptionController['triggerAccessTokenRefresh'];
228228
};
229229

230+
export type SubscriptionControllerStopAllPollingAction = {
231+
type: `SubscriptionController:stopAllPolling`;
232+
handler: SubscriptionController['stopAllPolling'];
233+
};
234+
230235
/**
231236
* Union of all SubscriptionController action types.
232237
*/
@@ -252,4 +257,5 @@ export type SubscriptionControllerMethodActions =
252257
| SubscriptionControllerGetTokenApproveAmountAction
253258
| SubscriptionControllerGetTokenMinimumBalanceAmountAction
254259
| SubscriptionControllerClearStateAction
255-
| SubscriptionControllerTriggerAccessTokenRefreshAction;
260+
| SubscriptionControllerTriggerAccessTokenRefreshAction
261+
| SubscriptionControllerStopAllPollingAction;

packages/subscription-controller/src/SubscriptionController.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ const MESSENGER_EXPOSED_METHODS = [
197197
'unCancelSubscription',
198198
'startShieldSubscriptionWithCard',
199199
'startSubscriptionWithCrypto',
200+
'stopAllPolling',
200201
'submitShieldSubscriptionCryptoApproval',
201202
'getCryptoApproveTransactionParams',
202203
'updatePaymentMethod',

packages/subscription-controller/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export type {
3232
SubscriptionControllerGetTokenMinimumBalanceAmountAction,
3333
SubscriptionControllerClearStateAction,
3434
SubscriptionControllerTriggerAccessTokenRefreshAction,
35+
SubscriptionControllerStopAllPollingAction,
3536
} from './SubscriptionController-method-action-types';
3637
export {
3738
SubscriptionController,

0 commit comments

Comments
 (0)