Skip to content
Open
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
1 change: 1 addition & 0 deletions packages/assets-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Revert `AccountsApiDataSource` `forceUpdate` balance fetch cache window from `staleTime`/`gcTime` of `100`ms back to `0`/`0` (undoes [#9591](https://github.com/MetaMask/core/pull/9591)) so forced refreshes truly bypass the TanStack cache instead of reusing a short-lived entry ([#9870](https://github.com/MetaMask/core/pull/9870))
- Properly filter empty (`''`) selected account group event ([#9825](https://github.com/MetaMask/core/pull/9825))

## [13.1.2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,15 +525,15 @@ describe('AccountsApiDataSource', () => {
controller.destroy();
});

it('uses a short-lived TanStack cache window when forceUpdate is true', async () => {
it('fetch bypasses TanStack cache when forceUpdate is true', async () => {
const { controller, apiClient } = await setupController();

await controller.fetch(createDataRequest({ forceUpdate: true }));

expect(apiClient.accounts.fetchV5MultiAccountBalances).toHaveBeenCalledWith(
[`eip155:1:${MOCK_ADDRESS}`],
undefined,
{ staleTime: 100, gcTime: 100 },
{ staleTime: 0, gcTime: 0 },
);

controller.destroy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ export class AccountsApiDataSource extends AbstractDataSource<
}

const fetchOptions = request.forceUpdate
? { staleTime: 100, gcTime: 100 }
? { staleTime: 0, gcTime: 0 }
: undefined;

// Feature-flagged: v6 endpoint with a fallback to legacy v5. The flag is
Expand Down