From 583efb9692d16c4b4576db1243c16ae387dfd9eb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 12 Sep 2026 08:09:15 +0000 Subject: [PATCH 1/2] Initial plan From ca9219d883d08e9b44a0cb9dfd55d49f19f1b61e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 12 Sep 2026 08:13:25 +0000 Subject: [PATCH 2/2] Bound updater download reads Co-authored-by: Valkirie <934757+Valkirie@users.noreply.github.com> --- HandheldCompanion/Managers/UpdateManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HandheldCompanion/Managers/UpdateManager.cs b/HandheldCompanion/Managers/UpdateManager.cs index df4b9973e..bb990c4a9 100644 --- a/HandheldCompanion/Managers/UpdateManager.cs +++ b/HandheldCompanion/Managers/UpdateManager.cs @@ -41,6 +41,7 @@ public enum UpdateStatus private static string updateUrl = string.Empty; private static readonly HttpClient httpClient; private static readonly string InstallPath; + private static readonly TimeSpan DownloadReadTimeout = TimeSpan.FromSeconds(30); private static Timer autoTimer = new(TimeSpan.FromMinutes(10)) { AutoReset = true }; @@ -280,7 +281,7 @@ public static async Task DownloadUpdateFile(UpdateFile update) var buffer = new byte[81920]; long bytesReadSoFar = 0; int read; - while ((read = await sourceStream.ReadAsync(buffer, 0, buffer.Length)) > 0) + while ((read = await sourceStream.ReadAsync(buffer, 0, buffer.Length).WaitAsync(DownloadReadTimeout)) > 0) { await destStream.WriteAsync(buffer, 0, read); bytesReadSoFar += read;