Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Dev Home can randomly crash when updating properties on Environments page #2947

@bbonaby

Description

@bbonaby

Dev Home version

No response

Windows build number

No response

Other software

No response

Steps to reproduce the bug

When an operation is perform in the environments page. E.g Starting/Stopping an environment we update the properties. For an unknown reason at this time the ObservableCollection can throw an exception when performing the OnCollectionChanged method. When an operation completes we update the properties for that environment as they could have changed. So we remove all the original values from the list and then add the new ones.

I added a try/catch in this PR: #2892

for the removal case : but I realize we still attempt to add to the collection later on after the orginal throws. Also this seems to happen randomly it is better to cover both in a try/catch so we don't crash Dev Home.

example trace:

`
[2024/05/16 09:44:38.049 ERR] (ComputeSystemHelpers) Unable to remove items from the collection
System.Runtime.InteropServices.COMException (0x80004005): Unspecified error

Unspecified error

at WinRT.ExceptionHelpers.g__Throw|39_0(Int32 hr)
at ABI.System.Collections.Specialized.NotifyCollectionChangedEventHandler.NativeDelegateWrapper.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at DevHome.Common.Environments.Helpers.ComputeSystemHelpers.RemoveAllItems[T](ObservableCollection1 collection)
[2024/05/16 09:44:38.164 ERR] (ComputeSystemHelpers) Unable to remove items from the collection
System.Runtime.InteropServices.COMException (0x80004005): Unspecified error

Unspecified error

at WinRT.ExceptionHelpers.g__Throw|39_0(Int32 hr)
at ABI.System.Collections.Specialized.NotifyCollectionChangedEventHandler.NativeDelegateWrapper.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at DevHome.Common.Environments.Helpers.ComputeSystemHelpers.RemoveAllItems[T](ObservableCollection1 collection)
`

Expected result

no crashing after performing an operation

Actual result

a random crash could happen

Included System Information

No response

Included Extensions Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions