Skip to content

Commit deb5469

Browse files
committed
chore: minor change to avoid tests flakiness
1 parent 65cf761 commit deb5469

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

app/core/Engine/Engine.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,12 @@ export class Engine {
274274
CaveatSpecificationConstraint
275275
>;
276276

277+
/**
278+
* Shared token list service. Stored so destroyEngineInstance can call
279+
* destroy() to abort in-flight requests and clear the TanStack Query cache.
280+
*/
281+
private tokenListService: TokenListService;
282+
277283
/**
278284
* Creates a CoreController instance
279285
*/
@@ -289,6 +295,7 @@ export class Engine {
289295

290296
const codefiTokenApiV2 = new CodefiTokenPricesServiceV2();
291297
const tokenListService = new TokenListService();
298+
this.tokenListService = tokenListService;
292299

293300
const initRequest = {
294301
getState: () => store.getState(),
@@ -1219,6 +1226,7 @@ export class Engine {
12191226
controller.destroy();
12201227
}
12211228
});
1229+
this.tokenListService.destroy();
12221230
this.removeAllListeners();
12231231
await this.resetState();
12241232

0 commit comments

Comments
 (0)