fix how we update the properties in environments page after an operation #2950
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.
Summary of the pull request
This issue doesn't happen often but it is still an issue that can crash Dev Home which I observed. See: #2947
I explained the issue in point 1 in this PR: #2892
Basically, when you perform any action in the environments page, e.g Starting/Stopping the properties are updated because they may have changed as a result of the operation. In the issue I how the exception that can happen when we attempt to remove the old items from the observable collection. But because we go on add items to the collection afterwards we get an exception. As a minimal change I'm moving the loop that add new items to the observable collection to the try/catch. And then if there is an exception create a new observable collection with the new items. This will least allow the user to see the updated properties.
In the future I'd like to investigate why the observable collection is throwing but for build we can do this work around
References and relevant issues
Detailed description of the pull request / Additional comments
Validation steps performed
PR checklist