-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show correct completion state after Dev Box creation and handle deletion during creation #163
Show correct completion state after Dev Box creation and handle deletion during creation #163
Conversation
@@ -76,7 +76,7 @@ private TestOptions TestOptions | |||
""provisioningState"": ""Succeeded"", | |||
""actionState"": ""Stopped"", | |||
""powerState"": ""Deallocated"", | |||
""uniqueId"": ""28feedaeb-996b-434b-bb57-4969cbeef8f0"", | |||
""uniqueId"": ""28feedae-996b-434b-bb57-4969cbeef8f0"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened here? This looks similar to the "user' guid below. If these are meant to be different, it's a good idea to generate a totally new one her to avoid confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interestingly if you look at the values a little closer you'll see that the original is actually an invalid guid (33 characters instead of 32). I believe we didn't have code that utilized needing to read this particular value until now. So, to utilize it the guid needs to be valid thats why I dropped the extra 'b' at the end.
@@ -142,6 +142,14 @@ public bool TryGetDevBoxInstanceIfBeingCreated(string id, out DevBoxInstance? de | |||
|
|||
lock (_creationLock) | |||
{ | |||
// The user previously chose to delete the Dev Box while it was being created. So it is no longer being | |||
// watched and we need to remove it from the creation map. | |||
if (!_devBoxOperationWatcher.IsIdBeingWatched(Guid.Parse(id)) && _devBoxesBeingCreated.ContainsKey(id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to check if id is in the dictionary. Remove will do it for you anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh noted for next time.
Summary of the pull request
This PR accomplishes two things:
DevHomeAzureExtension/src/AzureExtension/DevBox/DevBoxInstance.cs
Line 408 in deaf3be
DevHomeAzureExtension/src/AzureExtension/DevBox/DevBoxInstance.cs
Line 469 in deaf3be
The second thing this PR updates is allowing long running operations to be stopped when a delete action is initiated by the user. The delete action in terms of the actions we support is the only action that can be initiated while other operations are still in progress. (We're following the same pattern as devbox.microsoft.com)
I also fixed the spelling of some of the comments
Video where we see after creation the correct state is shown:
dev.box.creation.now.with.dynamic.operation.support.mp4
References and relevant issues
Detailed description of the pull request / Additional comments
related: microsoft/devhome#2732
Validation steps performed
PR checklist