Commands missing from command registry when workspace opened using workspace file (.theia-workspace file)

Hi all,
I’m tried opening a workspace with a large set of files in 2 ways:

  • Test #1.
    folderURI = uri for a folder that contains source code.
    This method always works fine.

  • Test #2.
    In this approach, a workspace file is created (e.g., a file myWorkspace.theia-workspace that has paths to folders that should be opened). when using this approach, some of the commands from CommandRegistry seem to be missing, eventhough they were added. The following error is shown:

command.ts:268 Uncaught (in promise) Error: The command 'myTestCommand' cannot be executed. There are no active handlers available for the command.
    at CommandRegistry.<anonymous> (command.ts:268)
    at step (command.ts:15)
    at (command.ts:15)
    at command.ts:15
    at new Promise (<anonymous>)
    at ../node_modules/@theia/core/lib/common/command.js.__awaiter (command.ts:15)
    at CommandRegistry.../node_modules/@theia/core/lib/common/command.js.CommandRegistry.executeCommand (command.ts:257)

Has anyone seen this issue before?

The workaround that I figured out is:

  1. Activate the navigator tree.
  2. Change selection to the 1st folder node under the workspace root.

Activating the navigator tree solved the issue, but not sure if it is the right solution.