Skip to content
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

Clicking on any disabled tab-toolbar item throws an error. #8035

Open
kittaakos opened this issue Jun 17, 2020 · 9 comments
Open

Clicking on any disabled tab-toolbar item throws an error. #8035

kittaakos opened this issue Jun 17, 2020 · 9 comments
Labels
bug bugs found in the application commands issues related to application commands

Comments

@kittaakos
Copy link
Contributor

Bug Description:

Steps to Reproduce:

  1. Open a workspace
  2. Open the Search view
  3. Check that the Clear Search Results is disabled. (It should be disabled)

Screen Shot 2020-06-17 at 15 29 54

  1. Click on it. It throws an error.
ncaught (in promise) TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'TheiaDockPanel'
    |     property '_layout' -> object with constructor 'DockLayout'
    --- property '_parent' closes the circle
    at JSON.stringify (<anonymous>)
    at CommandRegistry.<anonymous> (command.ts:298)
    at step (command.ts:15)
    at Object.next (command.ts:15)
    at command.ts:15
    at new Promise (<anonymous>)
    at ../../packages/core/lib/common/command.js.__awaiter (command.ts:15)
    at CommandRegistry.../../packages/core/lib/common/command.js.CommandRegistry.executeCommand (command.ts:290)
    at TabBarToolbar._this.executeCommand (tab-bar-toolbar.tsx:184)
    at HTMLUnknownElement.callCallback (react-dom.development.js:188)

Additional Information

  • Operating System:
  • Theia Version:
@kittaakos kittaakos added bug bugs found in the application search in workspace issues related to the search-in-workspace and removed search in workspace issues related to the search-in-workspace labels Jun 17, 2020
@kittaakos
Copy link
Contributor Author

Ohh, clicking on any disabled toolbar item throws an error.

@kittaakos kittaakos changed the title [siw] Clear Search Results throws an error when I click on the disabled toolbar item Clicking on any disabled tab-toolbar item throws an error. Jun 17, 2020
@vince-fugnitto
Copy link
Member

I've noticed the error before, it occurs when clicking a disabled toolbar item.

@vince-fugnitto vince-fugnitto added the toolbar issues related to the toolbar label Jun 17, 2020
@akosyakov
Copy link
Member

We should not serialize random args here: https://github.com/eclipse-theia/theia/blob/master/packages/core/src/common/command.ts#L298 Just drop args.

@akosyakov akosyakov added commands issues related to application commands good first issue good first issues for new contributors help wanted issues meant to be picked up, require help and removed toolbar issues related to the toolbar labels Jun 17, 2020
@kittaakos
Copy link
Contributor Author

Just drop args.

Why don't we rebind JSON.stringfy with a lib that can handle cycles?

@kittaakos
Copy link
Contributor Author

It's not just about whether we drop the args or not, but why does the command handler run when it is disabled?

@kittaakos kittaakos removed good first issue good first issues for new contributors help wanted issues meant to be picked up, require help labels Jun 17, 2020
kittaakos pushed a commit that referenced this issue Jun 17, 2020
@akosyakov
Copy link
Member

Why don't we rebind JSON.stringfy with a lib that can handle cycles?

I don't think it's meaningful to log widgets.

@kittaakos
Copy link
Contributor Author

I don't think it's meaningful to log widgets.

Sure, but it has a type or any[] and I want to see the details of the failed command in the logs.
Also, if we just drop the args from the log, it is still an error, we should not run the command when it is disabled.

@akosyakov
Copy link
Member

Sure, but it has a type or any[] and I want to see the details of the failed command in the logs.

I think command id is good enough. It is not first time when we see such exceptions i would prefer to remove it.

Also, if we just drop the args from the log, it is still an error, we should not run the command when it is disabled.

this, i agree, your PR looks good

@kittaakos
Copy link
Contributor Author

I think command id is good enough.

OK.

this, i agree, your PR looks good

Alright. Let's do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application commands issues related to application commands
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants