feat: add license check to setup wizard and status bar check#24
Merged
feat: add license check to setup wizard and status bar check#24
Conversation
TODO pause the flow
`undefined` return value was used in case of command error, however setup flow requires a definite outcome - either license is valid or any other outcome.
TODO move to the right modules
skyrpex
requested changes
Sep 4, 2025
Collaborator
skyrpex
left a comment
There was a problem hiding this comment.
Impressive, nice job! Please, check the feedback below 🙏🏻
src/plugins/setup.ts
Outdated
|
|
||
| commands.executeCommand("localstack.openLicensePage"); | ||
|
|
||
| await activateLicenseUntilValid(outputChannel); |
Collaborator
There was a problem hiding this comment.
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)); | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
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; |
Collaborator
There was a problem hiding this comment.
❤️ thank you for making it make sense 😆
It is a single action in user's eyes so should be wrapped within one single `minDelay`
skyrpex
reviewed
Sep 4, 2025
Co-authored-by: Cristian Pallarés <cristian.pallares@localstack.cloud>
Not really needed, we don't have it for other steps and less transitions are easier on eyes.
skyrpex
approved these changes
Sep 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds checking for localstack license during the setup process and as a part of
isSetupRequiredchecks 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:
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.