microsoft / vscode-azurestorage

Azure Storage extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurestorage
MIT License
61 stars 39 forks source link

[Unstable] The created blob container and queue don't show under "Local Emulator" after clicking "Start Blob Emulator" and "Start Queue Emulator" #1000

Open v-ruizh opened 3 years ago

v-ruizh commented 3 years ago

OS: Windows10 Build Version: 20210905.1 Regression: Not a regression

Repro Steps:

  1. Open one folder in VS Code.
  2. Navigate to Azure view -> Expand the Attached Storage Accounts -> Local Emulator -> Create a blob container and queue.
  3. Restart VS Code.
  4. Navigate to Local Emulator -> Click "Start Blob Emulator" and "Start Queue Emulator".
  5. Check whether the created blob container and queue show well under "Local Emulator".

Expect: The created blob container and queue show well under "Local Emulator".

Actual: The created blob container and queue don't show under "Local Emulator". one

More Info:

  1. This issue also reproduces on the previous released Azure Storage extension.
  2. This issue is unstable.
alexweininger commented 2 years ago

I haven't been able to reproduce this, however, I imagine that this is caused by us refreshing the node before Azurite is actually started. So maybe we could just delay our refresh by 500ms or so we could eliminate this.

nturinski commented 2 years ago

Unfortunately, even though the start commands are async, I think when they register the command, they don't await it

https://github.com/Azure/Azurite/blob/5cfe7af74889a9f2be6849733c942725b740ebdd/src/extension.ts#L74-L75

This might be making the await on the executeCommand not actually awaiting it. I'm guessing it's normally super fast so we never noticed this.

It's pretty annoying, but we can probably check to see if the emulator is running by pinging it or something before we refresh the tree item.

alexweininger commented 2 years ago

We could ask them (or submit a PR) to await those commands too.

nturinski commented 2 years ago

I think that's a good approach. It's a pretty intermittent bug at least, so there's not a huge urgency to do so.