Closed msschl closed 2 years ago
As a side note and not related to this bug:
When specifying the outputScheduler
prameter as RxApp.TaskpoolScheduler
on the CreateFromTask
method, I would expect the task to be scheduled on the passed in scheduler i.e.:
ReactiveCommand.CreateFromTask(token => AsyncWork(token), canExecuteCommand, outputScheduler: RxApp.TaskpoolScheduler);
However, this is not the case. This seems pretty counterintuitive. I had to search this on GH and found out that you need to add the extra ceremony of Task.Run(() => AsyncWork(token))
to schedule the task on the thread pool.
See #813
Re your side note The parameter name is outputScheduler, it's the thread that the contents is scheduled on since reactive commands are also observables. It's also how the documentation is worded.
Will read more about your actual bug won't have a reply immediately under the pump a bit with real life stuff at the moment.
Re your side note The parameter name is outputScheduler, it's the thread that the contents is scheduled on since reactive commands are also observables. It's also how the documentation is worded.
Ah, now I got it. Thanks, @glennawatson for the clarification. However, I still think that many others will fall into the same pitfall.
I think the issue is with the ToProperty might run on wrong thread. Try putting .ObserveOn(RxApp.MainThreadScheduler) before . ToProperty and see if it works.
And are you able to build reproduction repository?
I think the issue is with the ToProperty might run on wrong thread. Try putting .ObserveOn(RxApp.MainThreadScheduler) before . ToProperty and see if it works.
I've already done this. Still the same issue. I am running on ReactiveUI.WPF
version 18.0.10
and ReactiveUI.Validation
version 2.2.1
Will try to create a repro repository.
@tomasfil Here is a repro repository
This one is likely associated with https://github.com/dotnet/reactive/issues/1256
When would this be fixed? It is quite annoying having a task be canceled with a task cancelation token and then the UI stops working correctly.
Yeaah, I think this is related to https://github.com/reactiveui/ReactiveUI/pull/3246
Since then there was no release. I have noticed in commits that @glennawatson is preparing some kind of release, so once new update is out, then I believe this should work.
Need to fix the build again. I'll see if I can get a new release our this weekend
Fixed by #3246
ObservableAsPropertyHelper
is now working as expected.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Describe the bug 🐞
When the command throws an exception the next time the command starts running the
ObservableAsPropertyHelper
won't notify whether the command is running or not.Expected behavior
I would expect the
ObservableAsPropertyHelper
to still work as expected and notify the UI when the command is running even though the previous execution threw an exception.IDE
Visual Studio 2022
Operating system
Windows
Version
No response
Device
Windows PC
ReactiveUI Version
18.0.10
Additional information ℹ️
No response