From 84c6f6fed02408485599a4fae26379987b8a2e0f Mon Sep 17 00:00:00 2001 From: Allamagoosa <36551512+dmatlock171@users.noreply.github.com> Date: Thu, 20 Aug 2026 17:12:47 -0700 Subject: [PATCH] Scope cancelAllRequested to the run rather than to the drain Clearing it when the last cancellation settles reopens a worse window than it closes. A queue parked in WaitForDailyLimitAsync only re-reads the flag every poll interval, so pressing Cancel All during a limit pause with nothing in flight lets the drain finish and clear the flag well before the gate wakes - it sees false and resumes the book that was just cancelled. It is cleared in QueueLoop's finally instead, so it lasts exactly as long as the run it belongs to. Queueing more work still withdraws an earlier Cancel All, which is what AddToQueue's clear is for. --- Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs b/Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs index fe2ed2dc..7fadc4cc 100644 --- a/Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs +++ b/Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs @@ -652,7 +652,6 @@ public class ProcessQueueViewModel : ReactiveObject Serilog.Log.Logger.Information("Begin processing queue"); _badBookSession.Reset(); - cancelAllRequested = false; dailyLimitMessageShownThisRun = false; RunningTime = string.Empty; ProgressBarVisible = true; @@ -882,3 +881,7 @@ public class ProcessQueueViewModel : ReactiveObject : $"{time.TotalHours:F0}:{time:mm\\:ss}"; } } + // Scoped to the run, not to the drain. A queue parked in WaitForDailyLimitAsync only + // re-reads this every DailyLimitPollInterval, so clearing it when the last cancellation + // settles would let the gate wake up, see false, and resume the book just cancelled. + cancelAllRequested = false;