[BUGFIX lts] Cleans up the DebugRenderTree more thoroughly on errors #19199
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.
The DebugRenderTree is currently left in a bad state after an error
occurs during render. Specifically, if an error occurs and we call
capture
on the tree, it will throw errors because the state hasn'tbeen setup correctly. In real world development, this can happen
whenever the Ember Inspector is open and an app has errored, as the
inspector polls regardless of the state of the app and doesn't take
error state into account. This results in a follow on error to the
original error, which is confusing and can make it more difficult to
debug.
This can be reproduced using this repo and following
these steps:
This fixes the issue by removing the affected root altogether, so that
it will not attempt to capture in the first place.