Bug 522667 - CodeEdit: Reload Issue when using CodeEdit-Widget from Angular2. #202
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.
This ensures the tooling will restart correctly in the code edit widget.
The changes:
in the environment handler, we stop pre-computing the environment - this was found to be unnecessary, and was part of the cause of the race condition
we only want to the set the flag 'updateNeeded' to true, not simply to the result of the call to importantChange. Since the code edit widget sends so many requests about files being created so quickly, the other part of the race condition was that this flag would get set to false before it was consulted - this resulted in the tooling setting its state to "needs a reset" but then never doing the reset since the env state was not also set to "needs update"