vscode: showQuickPick return 'undefined' immediately without waiting for Promise is resolved.

  • VSCode Version: 1.22.1 or 1.22.2
  • OS Version: Windows

This issue could repro randomly (may be one tenth), and it usually happen when you just open VS Code.

Code to Reproduce:

Refer to https://github.com/Microsoft/vscode-azure-iot-toolkit/blob/521fb95b4b55a2d4db7204a96824981438771f08/src/iotHubResourceExplorer.ts#L143

Console log: /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:260 [Extension Host] ~~~[2018-04-28T03:13:48.936Z]loadIoTHubItems.start /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:260 [Extension Host] ~~~[2018-04-28T03:13:49.092Z]showQuickPick resolve: /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:260 [Extension Host] ~~~[2018-04-28T03:13:49.092Z]value:undefined /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:260 [Extension Host] ~~~[2018-04-28T03:13:50.683Z]loadIoTHubItems.length:3

Actual: loadIoTHubItems.length:3 indicates the Promise (iotHubItems) is resolved. However, the showQuickPick return ‘undefined’ immediately before Promise is resolved.

Expect the showQuickPick should wait for Promise to be resolved.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (14 by maintainers)

Most upvoted comments

  • Install IoT Toolkit extension
  • Run ‘Select IoT Hub’ command
  • Pick a subscription
  • Ensure the ‘Select IoT Hub’ picker does not close by itself: image

This was reported as not reproducing reliably, so please run it a few times to verify.