-
-
Notifications
You must be signed in to change notification settings - Fork 256
feat: add last subscription response #7110
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: State Log Snapshot Mismatch with Metadata (Bugbot Rules)
The test snapshot for includeInStateLogs still includes subscriptions in the expected output, but the metadata was changed to set includeInStateLogs: false for subscriptions. This will cause the test to fail since the snapshot expects subscriptions to be present but the metadata now excludes it from state logs. The snapshot needs updating to match the new metadata configuration.
packages/subscription-controller/src/SubscriptionController.test.ts#L1073-L1082
core/packages/subscription-controller/src/SubscriptionController.test.ts
Lines 1073 to 1082 in 0cfbd57
| paymentTokenAddress: '0xtoken', | |
| productType: PRODUCT_TYPES.SHIELD, | |
| interval: RECURRING_INTERVALS.month, | |
| }), | |
| ).toThrow('Product price not found'); | |
| }, | |
| ); | |
| }); | |
| it('throws when price not found for interval', async () => { |
|
@metamaskbot publish-preview |
Explanation
Add last subscription response in getSubscriptions method
References
Checklist
Note
Adds
lastSubscriptionto controller state andgetSubscriptionsresponse, updates comparison/update logic and metadata, extendsSubscriptionfields, and updates tests/changelog.lastSubscriptiontoSubscriptionControllerStateand wire intogetSubscriptions(fetch, compare, persist, expose to UI).#isSubscriptionEqualand reuse in#areSubscriptionsEqual; update state only whenlastSubscription/subscriptions/trialedProducts/customerIdchange.subscriptions.includeInStateLogs→false; addpersist/usedInUiflags; add metadata forlastSubscription.GetSubscriptionsResponsewithlastSubscription.SubscriptionwithcanceledAt,inactiveAt, and requiredisEligibleForSupport.isEligibleForSupport.lastSubscriptionstate update; adjust snapshots for metadata changes.lastSubscriptionaddition.Written by Cursor Bugbot for commit d9c1f29. This will update automatically on new commits. Configure here.