Skip to content

feat(subscription-controller): store benefit period window from the benefits API - #11666

Open
tuna1207 wants to merge 2 commits into
mainfrom
feat/subscription-benefit-period
Open

tuna1207 wants to merge 2 commits into
mainfrom
feat/subscription-benefit-period

Conversation

@tuna1207

@tuna1207 tuna1207 commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Explanation

The benefits API now returns benefitPeriodId, benefitPeriodStart, and benefitPeriodEnd for the monthly allowance window (va-mmcx-subscription-api#218). Annual plans still reset allowances monthly, so benefitPeriodEnd is that reset time rather than the yearly renewal date.

subscription-controller accepts the three fields as optional (older API responses still validate), stores them on state.benefits, and keeps billingPeriodId as a deprecated alias on the response.

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Made with Cursor


Note

Low Risk
Additive, backward-compatible shape changes and state mapping with no auth or payment logic touched.

Reviewed by Cursor Bugbot for commit 0b2a80b. Bugbot is set up for automated code reviews on this repo. Configure here.

tuna1207 and others added 2 commits November 19, 2026 22:58
…enefits API

Clients need the monthly reset end, which billingPeriodId does not carry for annual plans.

Co-authored-by: Cursor <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🛑 Files requiring codeowner review

To merge this PR, you'll need to get approvals from the following owners.

@MetaMask/web3auth (6 files)
  • packages/subscription-controller/CHANGELOG.md
  • packages/subscription-controller/src/SubscriptionController.test.ts
  • packages/subscription-controller/src/SubscriptionController.ts
  • packages/subscription-controller/src/SubscriptionService-structs.ts
  • packages/subscription-controller/src/SubscriptionService.test.ts
  • packages/subscription-controller/src/types.ts

ℹ️ Files co-owned by @MetaMask/core-platform (expand for more)

[!NOTE]
For convenience in maintaining this repo, @MetaMask/core-platform co-owns
the following files. It is not required to seek approval from
@MetaMask/core-platform to change these files. This section is purely
informational.

  • packages/subscription-controller/CHANGELOG.md

@tuna1207
tuna1207 marked this pull request as ready for review November 20, 2026 02:35
@tuna1207
tuna1207 requested review from a team as code owners November 20, 2026 02:35
@tuna1207
tuna1207 deployed to default-branch November 20, 2026 02:36 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
default-branch — 0b2a80b7 Deployed Nov 20, 2026 by tuna1207 via Determine whether this PR is a release PR #7413
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants