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
If a reactive command is executed from a pipeline using the InvokeCommand helper method on a background thread and the canExecute observable ticks at the same time on another thread a deadlock occurs.
The thread executing the command will acquire a look in the Switch in WithLatestFromFixed in ReactiveCommandsMixins and will then update isExecuting that will try to acquire the lock in CombineLatest between canExecute and isExecuting defined in the ReactiveCommand constructor.
The thread advancing CanExecute will acquire the lock in CombineLatest between canExecute and isExecuting defined in the ReactiveCommand constructor which is then propagated to the Select in WithLatestFromFixed in ReactiveCommandMixins that tries to acquire the lock in the Switch to update the source observable.
I am kind of new to ReactiveUI so not sure of how threading and scheduling is supposed to be handled, but as far as I can understand from the documentation one of the features is that invoking and executing commands can be done on any thread while the view model can still observe it on the UI thread. If this is a misunderstanding, I think this should be explained in the documentation.
Steps To Reproduce
I tried to simplify the steps to reproduce as far as possible and came up with this unit test. It will get stuck in a deadlock and never finish.
Expected behaviour
No deadlock, i.e. the test above passes.
OR
That the command section of the handbook (https://www.reactiveui.net/docs/handbook/commands/) describes the restrictions on multi threaded calls to reactive command.
Environment
OS: Windows 10 Enterprise
Version 20H2
Device: PC
ReactiveUI Version: 16.2.6
The text was updated successfully, but these errors were encountered:
If a reactive command is executed from a pipeline using the InvokeCommand helper method on a background thread and the canExecute observable ticks at the same time on another thread a deadlock occurs.
The thread executing the command will acquire a look in the Switch in WithLatestFromFixed in ReactiveCommandsMixins and will then update isExecuting that will try to acquire the lock in CombineLatest between canExecute and isExecuting defined in the ReactiveCommand constructor.
The thread advancing CanExecute will acquire the lock in CombineLatest between canExecute and isExecuting defined in the ReactiveCommand constructor which is then propagated to the Select in WithLatestFromFixed in ReactiveCommandMixins that tries to acquire the lock in the Switch to update the source observable.
I am kind of new to ReactiveUI so not sure of how threading and scheduling is supposed to be handled, but as far as I can understand from the documentation one of the features is that invoking and executing commands can be done on any thread while the view model can still observe it on the UI thread. If this is a misunderstanding, I think this should be explained in the documentation.
Steps To Reproduce
I tried to simplify the steps to reproduce as far as possible and came up with this unit test. It will get stuck in a deadlock and never finish.
Expected behaviour
No deadlock, i.e. the test above passes.
OR
That the command section of the handbook (https://www.reactiveui.net/docs/handbook/commands/) describes the restrictions on multi threaded calls to reactive command.
Environment
The text was updated successfully, but these errors were encountered: