Bug fix when a node get's removed after it's parent has already been removed #1303
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.
Fixed a but that happens when in certain cases when a state change decides a node and it's parent should be removed, because of timing issues (I think) it can happen that updatedChildren[j] is undefined when trying to remove itself from the parentNode.
I ran all tests and lint (which gave error's but not related to this pull request and tested the fix on our own code. I don't have a specific test case for this because I don't know how to trigger this scenario, but I assume this piece of code is already covered pretty well. If a specific test is required I am happy to do so with some guidance on how to trigger this behaviour without copying our own code :-)
A local fix is that instead of removing the child node I hide it instead, or applying this pull request.