Fixes to the tree expansion busy indicator #8582
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What it does
Busy expansion indicators in the navigator were added in #7249. Support was very kindly added through public methods to allow extenders to also show these busy indicators. However there are two bugs that need to be fixed.
A recursive call to markAsBusy should be a call to doMarkAsBusy. This bug prevents locks up on calls to markAsBusy. This function is not used internally by Theia so this bug would not have been found while testing Theia.
A second less serious bug is in doSetBusy. The problem was that the test
!!oldBusy === !!newBusy
is not picking up changes where the busy count changes from one non-zero value to another non-zero value. So node.busy is not updated.I also separated the function into separate 'set' and 'reset' functions. This simplifies the logic.
How to test
To see the bug one will need to add a custom extension that makes use of
markAsBusy
. I could add to examples if you like but I was not sure that's worthwhile for this.At least test that the existing use of the busy indicator works as before. This commit has been in our product for at least one round of testing and it works well for us.
Review checklist
Reminder for reviewers