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

fix infinity recursion when tree root is change during refresh #6679

Merged

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Dec 3, 2019

What it does

The navigator model root gets initialized too eagerly before the workspace service is ready to provide roots. And then the second time by an event when the workspace service is initialized. It causes 2 parallel refreshes and with bad timing on workspaces with multiple roots can lead to infinity loop and eventually max call stack error.

This PR:

  • resolves the issue generically for trees by allowing parallel refreshes without resetting a root
  • avoid initializing the navigator model root eagerly

How to test

  • There is a unit test reproducing it.
  • Test for regressions in the navigator and outline for example.
    • In the navigator try with multi-root workspaces with many roots and a single root. Check that files are revealed when an editor is selected and so on. Check that keyboard navigation is not broken.
    • In the outline switch between editors and check that outline is updated.
  • Check logs for Child node does not belong to this tree error.

Review checklist

Reminder for reviewers

@akosyakov akosyakov added navigator issues related to the navigator/explorer tree issues related to the tree (ex: tree widget) labels Dec 3, 2019
@akosyakov akosyakov force-pushed the ak/tree_parallel_refresh branch from 470755f to dafd7ca Compare December 3, 2019 12:37
…g refresh

The navigator model root gets initialized too eagerly before the workspace service is ready to provide roots. And then the second time by an event then the workspace service is initialized. It causes 2 parallel refreshes and with bad timing on workspaces with multiple roots can lead to infinity loop and eventually max call stack error.

This resolves the issue generically for trees by allowing parallel refreshes without resetting a root.

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
@akosyakov akosyakov force-pushed the ak/tree_parallel_refresh branch from dafd7ca to 566cb5e Compare December 3, 2019 15:01
@akosyakov akosyakov marked this pull request as ready for review December 3, 2019 15:40
Copy link
Contributor

@svenefftinge svenefftinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. I also tested it and everything worked nicely.

Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
navigator issues related to the navigator/explorer tree issues related to the tree (ex: tree widget)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants