Skip to content

Comments

feat: add license check to setup wizard and status bar check#24

Merged
tiurin merged 15 commits intomainfrom
add-license-check-to-setup-wizard
Sep 4, 2025
Merged

feat: add license check to setup wizard and status bar check#24
tiurin merged 15 commits intomainfrom
add-license-check-to-setup-wizard

Conversation

@tiurin
Copy link
Collaborator

@tiurin tiurin commented Sep 4, 2025

Adds checking for localstack license during the setup process and as a part of isSetupRequired checks on startup and in status bar.

Also adds proactive license activation to mitigate caching issues and unnecessary redirects when activation can be done in the background.

License check and activation are performed right after authentication.

Updated setup flow with license activation:

auth_and_license_activation_in_setup_wizard

Note: Not adding telemetry yet as I want to clarify schema update process first - this PR adds another step in the middle of setup flow therefore step positions shift.

Copy link
Collaborator

@skyrpex skyrpex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive, nice job! Please, check the feedback below 🙏🏻


commands.executeCommand("localstack.openLicensePage");

await activateLicenseUntilValid(outputChannel);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should pass the cancellationToken here and handle the case when the user cancels the setup wizard.

Comment on lines 30 to 42
export async function activateLicenseUntilValid(
outputChannel: LogOutputChannel,
): Promise<void> {
while (true) {
const licenseIsValid = await checkIsLicenseValid(outputChannel);
if (licenseIsValid) {
break;
}
await activateLicense(outputChannel);
// Wait before trying again
await new Promise((resolve) => setTimeout(resolve, 1000));
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As said in a previous comment, let's accept a cancellationToken here.

I believe it should be as easy as adding:

if (cancellationToken.isCancellationRequested) {
  break;
}

Comment on lines -4 to 8
/**
* Setting up a minimum wait time of 1s allows users
* Setting up a minimum wait time allows users
* to visually grasp the text before it goes away, if
* the task was fast (less than 0.5s).
* the task was faster than the minimum wait time.
*/
const MIN_TIME_BETWEEN_STEPS_MS = 500;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ thank you for making it make sense 😆

@skyrpex skyrpex changed the title Add license check to setup wizard and status bar check feat: add license check to setup wizard and status bar check Sep 4, 2025
It is a single action in user's eyes so should be wrapped within one single `minDelay`
@tiurin tiurin requested a review from skyrpex September 4, 2025 12:55
Co-authored-by: Cristian Pallarés <cristian.pallares@localstack.cloud>
@tiurin tiurin requested a review from skyrpex September 4, 2025 13:13
Not really needed, we don't have it for other steps and less transitions are easier on eyes.
@tiurin tiurin merged commit b049377 into main Sep 4, 2025
3 checks passed
@tiurin tiurin deleted the add-license-check-to-setup-wizard branch September 4, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants