-
-
Notifications
You must be signed in to change notification settings - Fork 193
Open
Labels
Description
Describe the bug 🐞
ObservableListEx.OnItemRemoved swallows exceptions which are thrown in the upstream. See Step to reproduce below.
Step to reproduce
public void TestExceptionInUpstream()
{
bool thrown = false;
SourceList<int> list = new SourceList<int>();
list.Connect()
.Do(_ =>
{
thrown = true;
throw new InvalidOperationException("Test");
})
.OnItemRemoved(_ => {})
.Subscribe();
list.Add(1); // This should throw, but does not.
Console.WriteLine($"thrown: {thrown}."); // We should never get here, but get this line in the console output.
}
Reproduction repository
N/A
Expected behavior
public void ExpectedBehavior()
{
bool thrown = false;
SourceList<int> list = new SourceList<int>();
list.Connect()
.Do(_ =>
{
thrown = true;
throw new InvalidOperationException("Test");
})
.OnItemAdded(_ => { })
.Subscribe();
list.Add(1); // This throws the exception.
Console.WriteLine($"thrown: {thrown}."); // We never get here.
}
Screenshots 🖼️
No response
IDE
No response
Operating system
No response
Version
No response
Device
No response
DynamicData Version
9.4.1
Additional information ℹ️
Maybe this is related to dotnet/reactive#1904
Reactions are currently unavailable