Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/subscription-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- **BREAKING**: Added two new params, `captureException` and `fetchFunction` to `SubscriptionService` constructor args. ([#7835](https://github.com/MetaMask/core/pull/7835))
- `fetchFunction` is to use the client provided `Fetch` API.
- `captureException` is to capture the error thrown and report to Sentry.

### Changed

- Updated `SubscriptionServiceError` to include more information for Sentry reporting. ([#7835](https://github.com/MetaMask/core/pull/7835))
- Bump `@metamask/profile-sync-controller` from `^27.0.0` to `^27.1.0` ([#7849](https://github.com/MetaMask/core/pull/7849))
- Bump `@metamask/transaction-controller` from `^62.12.0` to `^62.14.0` ([#7802](https://github.com/MetaMask/core/pull/7802), [#7832](https://github.com/MetaMask/core/pull/7832))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,23 @@ describe('SubscriptionController', () => {
});
});

it('should surface triggerAccessTokenRefresh errors', async () => {
await withController(
async ({ controller, mockService, mockPerformSignOut }) => {
mockService.getSubscriptions.mockResolvedValue(
MOCK_GET_SUBSCRIPTIONS_RESPONSE,
);
mockPerformSignOut.mockImplementation(() => {
throw new Error('Wallet is locked');
});

await expect(controller.getSubscriptions()).rejects.toThrow(
'Wallet is locked',
);
},
);
});

it('should update state when subscription is fetched', async () => {
const initialSubscription = { ...MOCK_SUBSCRIPTION, id: 'sub_old' };
const newSubscription = { ...MOCK_SUBSCRIPTION, id: 'sub_new' };
Expand Down
Loading