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

Problems View does not display all Problems when they are reported to fast #13750

Closed
meisenbarth-work opened this issue Jun 3, 2024 · 5 comments · Fixed by #13841
Closed
Labels
bug bugs found in the application problems issues related to the problems widget
Milestone

Comments

@meisenbarth-work
Copy link

meisenbarth-work commented Jun 3, 2024

Bug Description:

The Problems View does not display all problems in the tree when problems are reported too fast. The counter at the panel is correct, but problems are missing,

The problems are added to an array, the adding of the problems is delayed, probably for performance reasons.

this.markers.push({ node, markers });

The array is sorted, changing the order within the array.

ProblemCompositeTreeNode.addChildren(this.root as MarkerRootNode, this.markers);

const sortedInsertChildren = insertChildren.sort(

The nodes are added, since the order changed, the node without errors and only warnings replaces the one with errors.

for (const { node, markers } of this.markers) {

this.setChildren(node, children);

this.removeNode(parent);

It looks like the problem manager should provide all current problems for a specific file. Thus I assume it would be okay to remove other occurrences of the node from the markers array before adding a new entry? Otherwise a copy of the markers array could be sorted, but it looks like a waste to add nodes just to remove them in the next step again.

Steps to Reproduce:

  1. Have a Problem Watcher that handles output
  2. Have first warnings and than an error in the output, the error must be less than 50ms away from the last warning
  3. The error is not displayed

Additional Information

  • Operating System: Windows 10
  • Theia Version: 1.45
@msujew msujew added bug bugs found in the application problems issues related to the problems widget labels Jun 3, 2024
@tsmaeder
Copy link
Contributor

tsmaeder commented Jun 4, 2024

If I understand correctly, the problem already exists once we do

 this.markers.push({ node, markers }); 

If the line is invoked twice before the debounced doInsertNodesWithMarkers() method is invoked, we end up with two entries in this.markers for the same node.
Generally, I wonder why this model is so complicated: can't we just refresh the nodes and let the virtualized tree take care of performance issues?

@meisenbarth-work since you seem to have analyzed this problem thoroughly, would you fancy doing a PR to fix it?

@meisenbarth-work
Copy link
Author

The debounce and array are from https://github.com/eclipse-theia/theia/pull/12408/files#diff-62bf371138c21435be92f9a1aedb041297aa9623f9218736eb930aff29dcd3f1 to fix a performance issue. Removing this (again) is probably not desired.

Regarding the PR, i would rather not, since I don't know how (technically and legally).

@msujew
Copy link
Member

msujew commented Jun 24, 2024

This will be fixed in #13841. I initially only wanted to fix #13835, but the root problem is the same - multiple nodes for the same file in the problem widget mess with the tree widget implementation. By replacing the array with a map, we circumvent the issue completely.

@tsmaeder
Copy link
Contributor

@meisenbarth-work could you check your use case once the linked PR is merged, please?

@jfaltermeier jfaltermeier added this to the 1.51.0 milestone Jun 27, 2024
@meisenbarth-work
Copy link
Author

Sorry for the late reply, i can confirm the bug could not be reproduced anymore after applying the fix.
Thanks a lot.

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 problems issues related to the problems widget
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants