From cc747ca409ff35c329d17443e3e33db8049f8da2 Mon Sep 17 00:00:00 2001 From: Evgueni Driouk Date: Wed, 18 Mar 2026 17:27:55 +0100 Subject: [PATCH 1/2] RPC: Tolerate non-critical errors when loading solution --- tools/projmgr/src/ProjMgrRpcServer.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/projmgr/src/ProjMgrRpcServer.cpp b/tools/projmgr/src/ProjMgrRpcServer.cpp index 4e586e6bc..2071b7b33 100644 --- a/tools/projmgr/src/ProjMgrRpcServer.cpp +++ b/tools/projmgr/src/ProjMgrRpcServer.cpp @@ -291,8 +291,13 @@ RpcArgs::SuccessResult RpcHandler::LoadSolution(const string& solution, const st result.message = solution + " is not a *.csolution.yml file"; return result; } - result.success = m_solutionLoaded = m_manager.LoadSolution(csolutionFile, activeTarget); - if(!m_solutionLoaded) { + // we disregard return value of m_manager.LoadSolution() here, because we tolerate some errors + m_manager.LoadSolution(csolutionFile, activeTarget); + map* contexts = nullptr; + m_worker.GetContexts(contexts); + result.success = m_solutionLoaded = contexts && !contexts->empty(); + if(!result.success) { + // severe situation: contexts were not populated result.message = "failed to load and process solution " + csolutionFile; } return result; From dba5eca51b224764d14fb07f2752ed6220c37e71 Mon Sep 17 00:00:00 2001 From: Evgueni Driouk Date: Wed, 18 Mar 2026 17:39:54 +0100 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- tools/projmgr/src/ProjMgrRpcServer.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/projmgr/src/ProjMgrRpcServer.cpp b/tools/projmgr/src/ProjMgrRpcServer.cpp index 2071b7b33..ce8698625 100644 --- a/tools/projmgr/src/ProjMgrRpcServer.cpp +++ b/tools/projmgr/src/ProjMgrRpcServer.cpp @@ -295,9 +295,19 @@ RpcArgs::SuccessResult RpcHandler::LoadSolution(const string& solution, const st m_manager.LoadSolution(csolutionFile, activeTarget); map* contexts = nullptr; m_worker.GetContexts(contexts); - result.success = m_solutionLoaded = contexts && !contexts->empty(); + bool hasUsableContext = false; + if (contexts && !contexts->empty()) { + // ensure at least one context has a valid active target + for (const auto& contextItem : *contexts) { + if (contextItem.second.rteActiveTarget != nullptr) { + hasUsableContext = true; + break; + } + } + } + result.success = m_solutionLoaded = hasUsableContext; if(!result.success) { - // severe situation: contexts were not populated + // severe situation: contexts were not populated or are unusable result.message = "failed to load and process solution " + csolutionFile; } return result;