From 4d1639230c7e9e9726cb0f496cc44b778a9c51b9 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 19 Jul 2024 05:18:51 -0400 Subject: [PATCH 1/2] fix(mvux): Fix possible cross threading exception in refresh command --- .../View/FeedView.Refresh.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Uno.Extensions.Reactive.UI/View/FeedView.Refresh.cs b/src/Uno.Extensions.Reactive.UI/View/FeedView.Refresh.cs index 62046263d4..305950c30a 100644 --- a/src/Uno.Extensions.Reactive.UI/View/FeedView.Refresh.cs +++ b/src/Uno.Extensions.Reactive.UI/View/FeedView.Refresh.cs @@ -61,7 +61,7 @@ public void Execute(object? parameter) { try { - subscription.RequestRefresh(() => IsExecuting = false); + subscription.RequestRefresh(EndExecution); } catch (Exception error) { @@ -69,9 +69,16 @@ public void Execute(object? parameter) { this.Log().Warn(error, "Failed to send a refresh request"); } - IsExecuting = false; + EndExecution(); } }); + + void EndExecution() +#if WINUI + => _view.DispatcherQueue.TryEnqueue(() => IsExecuting = false); +#else + => _view.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => IsExecuting = false); +#endif } } } From bdf3254b1ce01911cc970de5a0f1985aa8e62ffd Mon Sep 17 00:00:00 2001 From: David Date: Fri, 19 Jul 2024 08:51:26 -0400 Subject: [PATCH 2/2] chore: Fix CI --- src/Uno.Extensions.Reactive.UI/View/FeedView.Refresh.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Uno.Extensions.Reactive.UI/View/FeedView.Refresh.cs b/src/Uno.Extensions.Reactive.UI/View/FeedView.Refresh.cs index 305950c30a..1c664a544f 100644 --- a/src/Uno.Extensions.Reactive.UI/View/FeedView.Refresh.cs +++ b/src/Uno.Extensions.Reactive.UI/View/FeedView.Refresh.cs @@ -75,9 +75,9 @@ public void Execute(object? parameter) void EndExecution() #if WINUI - => _view.DispatcherQueue.TryEnqueue(() => IsExecuting = false); + => _ = _view.DispatcherQueue.TryEnqueue(() => IsExecuting = false); #else - => _view.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => IsExecuting = false); + => _ = _view.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => IsExecuting = false); #endif } }