From e51bbcfd77ba774c6027adb6982a70d205576217 Mon Sep 17 00:00:00 2001 From: Anisa Oshafi Date: Fri, 7 Nov 2025 12:29:13 +0100 Subject: [PATCH 1/2] fix: license check in status tracker --- src/utils/setup-status.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/utils/setup-status.ts b/src/utils/setup-status.ts index c3b70e0..35472fa 100644 --- a/src/utils/setup-status.ts +++ b/src/utils/setup-status.ts @@ -13,8 +13,13 @@ import { } from "./configure-aws.ts"; import { createEmitter } from "./emitter.ts"; import { immediateOnce } from "./immediate-once.ts"; -import { checkIsLicenseValid, LICENSE_FILENAME } from "./license.ts"; +import { + checkIsLicenseValid, + activateLicense, + LICENSE_FILENAME, +} from "./license.ts"; import type { UnwrapPromise } from "./promises.ts"; +import { minDelay } from "./promises.ts"; import { checkSetupStatus } from "./setup.ts"; import type { TimeTracker } from "./time-tracker.ts"; @@ -277,6 +282,12 @@ function createLicenseStatusTracker( "[setup-status.license]", [LOCALSTACK_AUTH_FILENAME, LICENSE_FILENAME], //TODO rewrite to depend on change in localStackAuthenticationTracker async () => - (await checkIsLicenseValid(outputChannel)) ? "ok" : "setup_required", + (await minDelay( + activateLicense(outputChannel).then(() => + checkIsLicenseValid(outputChannel), + ), + )) + ? "ok" + : "setup_required", ); } From 48f54682bd1d926700cb671790bff09478700f9e Mon Sep 17 00:00:00 2001 From: Anisa Oshafi Date: Fri, 7 Nov 2025 13:50:12 +0100 Subject: [PATCH 2/2] Address comment: remove min delay --- src/utils/setup-status.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/utils/setup-status.ts b/src/utils/setup-status.ts index 35472fa..7785264 100644 --- a/src/utils/setup-status.ts +++ b/src/utils/setup-status.ts @@ -19,7 +19,6 @@ import { LICENSE_FILENAME, } from "./license.ts"; import type { UnwrapPromise } from "./promises.ts"; -import { minDelay } from "./promises.ts"; import { checkSetupStatus } from "./setup.ts"; import type { TimeTracker } from "./time-tracker.ts"; @@ -282,10 +281,8 @@ function createLicenseStatusTracker( "[setup-status.license]", [LOCALSTACK_AUTH_FILENAME, LICENSE_FILENAME], //TODO rewrite to depend on change in localStackAuthenticationTracker async () => - (await minDelay( - activateLicense(outputChannel).then(() => - checkIsLicenseValid(outputChannel), - ), + (await activateLicense(outputChannel).then(() => + checkIsLicenseValid(outputChannel), )) ? "ok" : "setup_required",