From 2816c76c2bdf5ffcbb1fec7a6c29259be8d49795 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 22 May 2026 07:25:18 -0400 Subject: [PATCH] fix(client-ui): resolve Medium code-review finding (Client.UI-001) Route the synchronous IsLoading = true write through _dispatcher.Post so both IsLoading assignments use the same dispatch path as Results.Clear() and the final IsLoading = false, eliminating the ordering hazard. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../ZB.MOM.WW.OtOpcUa.Client.UI/ViewModels/HistoryViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client/ZB.MOM.WW.OtOpcUa.Client.UI/ViewModels/HistoryViewModel.cs b/src/Client/ZB.MOM.WW.OtOpcUa.Client.UI/ViewModels/HistoryViewModel.cs index 462ba9a..d828dfa 100644 --- a/src/Client/ZB.MOM.WW.OtOpcUa.Client.UI/ViewModels/HistoryViewModel.cs +++ b/src/Client/ZB.MOM.WW.OtOpcUa.Client.UI/ViewModels/HistoryViewModel.cs @@ -73,7 +73,7 @@ public partial class HistoryViewModel : ObservableObject { if (string.IsNullOrEmpty(SelectedNodeId)) return; - IsLoading = true; + _dispatcher.Post(() => IsLoading = true); _dispatcher.Post(() => Results.Clear()); try