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

Logging to the console from a plug-in may cause the cyclic messaging #18598

Open
3 of 22 tasks
azatsarynnyy opened this issue Dec 11, 2020 · 5 comments
Open
3 of 22 tasks
Labels
area/editor/theia Issues related to the che-theia IDE of Che kind/bug Outline of a bug - must adhere to the bug report template. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. severity/P2 Has a minor but important impact to the usage or development of the system.

Comments

@azatsarynnyy
Copy link
Member

azatsarynnyy commented Dec 11, 2020

Describe the bug

If a plug-in logs to the console from vscode.TextDocumentChangeEvent listener function it leads to the cyclic messaging.

Investigation details.

When a plug-in writes to the console the messages are forwarded to Che-Theia output channel. Output channel widget's content is rendered with Monaco editor. That means every message sent to the console adds a content to a Monaco editor which fires it's onDidChangeContent event. This event is passed to the plug-in system.
If a plug-in sets a listener with vscode.workspace.onDidChangeTextDocument Plug-in API and logs to the console from inside the listener function it causes the cyclic messaging. E.g.:

import * as vscode from "vscode";
export function activate(context: vscode.ExtensionContext) {
  vscode.workspace.onDidChangeTextDocument(
    (e: vscode.TextDocumentChangeEvent) => console.log(e.document.fileName)
  );
}

Note, the issue isn't reproduced on upstream Theia.

Che version

  • latest
  • nightly
  • other: please specify

Steps to reproduce

  1. Create a Workspace from the Devfile below:
apiVersion: 1.0.0
metadata:
  name: text-document-api-test
attributes:
  persistVolumes: 'false'
components:
  - type: chePlugin
    reference: 'https://raw.githubusercontent.com/azatsarynnyy/text-document-api-test/main/meta.yaml'
  1. Open hosted-instance-log output channel view (View->Output).

Expected behavior

console.log from inside a vscode.workspace.onDidChangeTextDocument listener function shouldn't cause firing Monaco's onDidChangeContent event.

Runtime

  • kubernetes (include output of kubectl version)
  • Openshift (include output of oc version)
  • minikube (include output of minikube version and kubectl version)
  • minishift (include output of minishift version and oc version)
  • docker-desktop + K8S (include output of docker version and kubectl version)
  • other: (please specify)

Screenshots

Peek 2020-12-11 08-04

Installation method

  • chectl
    • provide a full command that was used to deploy Eclipse Che (including the output)
    • provide an output of chectl version command
  • OperatorHub
  • I don't know

Environment

  • my computer
    • Windows
    • Linux
    • macOS
  • Cloud
    • Amazon
    • Azure
    • GCE
    • other (please specify)
  • other: please specify

Eclipse Che Logs

Additional context

@azatsarynnyy azatsarynnyy added kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system. area/editor/theia Issues related to the che-theia IDE of Che labels Dec 11, 2020
@azatsarynnyy
Copy link
Member Author

I've filed the related upstream issue eclipse-theia/theia#8855
If we decide it's an upstream bug then fixing it upstream will fix this one as well, in Che-Theia.
If eclipse-theia/theia#8855 is a feature then we should investigate how to fix it in Che-Theia.

@tsmaeder
Copy link
Contributor

Not sure if it's related: eclipse-che/che-theia#528

@azatsarynnyy
Copy link
Member Author

Not sure if it's related: eclipse/che-theia#528

It seems related. Thanks!

@che-bot
Copy link
Contributor

che-bot commented Jun 18, 2021

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 18, 2021
@tsmaeder tsmaeder added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 18, 2021
@tsmaeder
Copy link
Contributor

It ain't going away until we fix it :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/theia Issues related to the che-theia IDE of Che kind/bug Outline of a bug - must adhere to the bug report template. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
None yet
Development

No branches or pull requests

3 participants