You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If a command throws an exception and it gets executed again later, IsExecuting will remain false.
Steps To Reproduce
Basically added 2 lines of code to an existing test.
[Fact]publicasyncTaskCommandIsExecutingTest(){varsubj=newSubject<Unit>();boolisExecuting=false;Exception?fail=null;varfixture=ReactiveCommand.CreateFromTask(async()=>{awaitsubj.Take(1);thrownewException();});fixture.IsExecuting.Subscribe(x =>isExecuting=x);fixture.ThrownExceptions.Subscribe(ex =>fail=ex);Assert.False(isExecuting);Assert.Null(fail);fixture.Execute().Subscribe();Assert.True(isExecuting);Assert.Null(fail);subj.OnNext(Unit.Default);// Wait 1 ms to allow execution to completeawaitTask.Delay(1).ConfigureAwait(false);Assert.False(isExecuting);Assert.NotNull(fail);fixture.Execute().Subscribe();Assert.True(isExecuting);// Fails here.}
Expected behaviour IsExecuting should be true when the command is executing.
Environment
OS: Windows 10, .NET SDK 5.0.206, Runtime 5.0.9
ReactiveUI Version: 15.1.1
The text was updated successfully, but these errors were encountered:
We are trying to come up with a resolve for this but the root cause is in the System.Reactive code dotnet/reactive#1256
This issue has been outstanding for quite some time.
For what it's worth, if anyone else is trying to work around this issue, the following approach of explicitly catching the exception within the command observable worked for me:
Describe the bug
If a command throws an exception and it gets executed again later,
IsExecuting
will remainfalse
.Steps To Reproduce
Basically added 2 lines of code to an existing test.
Expected behaviour
IsExecuting
should betrue
when the command is executing.Environment
The text was updated successfully, but these errors were encountered: