From bbf815f739f9ae1b2eb02892ebe05f8572eb91c1 Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Tue, 24 Feb 2026 23:28:53 +0100 Subject: [PATCH] remove dead UploadBundle code and fix Lenovo model detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove UploadBundleRequest, UploadBundleResponse classes (ApiModels.cs) - Remove UploadBundle API endpoint constant (Constants.cs) - Remove GetBundleUploadUrlAsync method (BackendApiClient.cs) — no callers anywhere - Fix HardwareInfo: Lenovo devices report the marketing model name in Win32_ComputerSystemProduct.Version, not Win32_ComputerSystem.Model; add Lenovo-specific WMI fallback for correct model string Co-Authored-By: Claude Sonnet 4.6 --- .../Monitoring/Network/BackendApiClient.cs | 10 --------- .../AutopilotMonitor.Shared/Constants.cs | 3 +-- .../Models/ApiModels.cs | 22 ------------------- 3 files changed, 1 insertion(+), 34 deletions(-) diff --git a/src/Agent/AutopilotMonitor.Agent.Core/Monitoring/Network/BackendApiClient.cs b/src/Agent/AutopilotMonitor.Agent.Core/Monitoring/Network/BackendApiClient.cs index 21db86c6..7606bf84 100644 --- a/src/Agent/AutopilotMonitor.Agent.Core/Monitoring/Network/BackendApiClient.cs +++ b/src/Agent/AutopilotMonitor.Agent.Core/Monitoring/Network/BackendApiClient.cs @@ -135,16 +135,6 @@ namespace AutopilotMonitor.Agent.Core.Monitoring.Network return result; } - /// - /// Gets a SAS URL for uploading a troubleshooting bundle - /// - public async Task GetBundleUploadUrlAsync(UploadBundleRequest request) - { - var url = $"{_baseUrl}{Constants.ApiEndpoints.UploadBundle}"; - var response = await PostAsync(url, request); - return response; - } - /// /// Requests a short-lived SAS URL for diagnostics package upload. /// Called just before upload so the URL is never stored in config or on disk. diff --git a/src/Shared/AutopilotMonitor.Shared/Constants.cs b/src/Shared/AutopilotMonitor.Shared/Constants.cs index d45f64dd..28628c33 100644 --- a/src/Shared/AutopilotMonitor.Shared/Constants.cs +++ b/src/Shared/AutopilotMonitor.Shared/Constants.cs @@ -69,8 +69,7 @@ namespace AutopilotMonitor.Shared { public const string RegisterSession = "/api/sessions/register"; public const string IngestEvents = "/api/events/ingest"; - public const string UploadBundle = "/api/bundles/upload"; - public const string GetAgentConfig = "/api/agent/config"; +public const string GetAgentConfig = "/api/agent/config"; public const string GatherRules = "/api/gather-rules"; public const string AnalyzeRules = "/api/analyze-rules"; public const string GetDiagnosticsUploadUrl = "/api/diagnostics/upload-url"; diff --git a/src/Shared/AutopilotMonitor.Shared/Models/ApiModels.cs b/src/Shared/AutopilotMonitor.Shared/Models/ApiModels.cs index c4565ba0..0b1fc3a0 100644 --- a/src/Shared/AutopilotMonitor.Shared/Models/ApiModels.cs +++ b/src/Shared/AutopilotMonitor.Shared/Models/ApiModels.cs @@ -86,28 +86,6 @@ namespace AutopilotMonitor.Shared.Models public int RetryAfterSeconds { get; set; } } - /// - /// Request to upload a troubleshooting bundle - /// - public class UploadBundleRequest - { - public string SessionId { get; set; } - public string TenantId { get; set; } - public string BundleFileName { get; set; } - } - - /// - /// Response with SAS URL for bundle upload - /// - public class UploadBundleResponse - { - public bool Success { get; set; } - public string SasUrl { get; set; } - public string BlobPath { get; set; } - public DateTime ExpiresAt { get; set; } - public string Message { get; set; } - } - /// /// Request to get a short-lived SAS URL for diagnostics package upload. /// Called by the agent just before upload — the URL is never cached in config.