From 3763b1e4a482f3582aa967ee8005e70e4787892a Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 24 Jan 2026 20:17:35 +0100 Subject: [PATCH] Improved the enterprise environment service (#636) --- .../Services/EnterpriseEnvironmentService.cs | 46 +++++++++++++++---- .../wwwroot/changelog/v26.1.2.md | 5 +- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/app/MindWork AI Studio/Tools/Services/EnterpriseEnvironmentService.cs b/app/MindWork AI Studio/Tools/Services/EnterpriseEnvironmentService.cs index 079224c6..ff727129 100644 --- a/app/MindWork AI Studio/Tools/Services/EnterpriseEnvironmentService.cs +++ b/app/MindWork AI Studio/Tools/Services/EnterpriseEnvironmentService.cs @@ -34,16 +34,46 @@ public sealed class EnterpriseEnvironmentService(ILogger plugin.Id == enterpriseRemoveConfigId); if (enterpriseRemoveConfigId != Guid.Empty && isPlugin2RemoveInUse) { - logger.LogWarning($"The enterprise environment configuration ID '{enterpriseRemoveConfigId}' must be removed."); + logger.LogWarning("The enterprise environment configuration ID '{EnterpriseRemoveConfigId}' must be removed.", enterpriseRemoveConfigId); PluginFactory.RemovePluginAsync(enterpriseRemoveConfigId); } - - var enterpriseConfigServerUrl = await rustService.EnterpriseEnvConfigServerUrl(); - var enterpriseConfigId = await rustService.EnterpriseEnvConfigId(); + + string? enterpriseConfigServerUrl; + try + { + enterpriseConfigServerUrl = await rustService.EnterpriseEnvConfigServerUrl(); + } + catch (Exception e) + { + logger.LogError(e, "Failed to fetch the enterprise configuration server URL from the Rust service."); + return; + } + + Guid enterpriseConfigId; + try + { + enterpriseConfigId = await rustService.EnterpriseEnvConfigId(); + } + catch (Exception e) + { + logger.LogError(e, "Failed to fetch the enterprise configuration ID from the Rust service."); + return; + } + var etag = await PluginFactory.DetermineConfigPluginETagAsync(enterpriseConfigId, enterpriseConfigServerUrl); var nextEnterpriseEnvironment = new EnterpriseEnvironment(enterpriseConfigServerUrl, enterpriseConfigId, etag); if (CURRENT_ENVIRONMENT != nextEnterpriseEnvironment) @@ -59,15 +89,15 @@ public sealed class EnterpriseEnvironmentService(ILogger