fix(limit): let newly queued books withdraw a pending Cancel All

Cancel All sets a flag the daily-limit wait loop watches. If books were queued
while the cancelled book was still settling, the queue was still running, so
those new books inherited the cancellation at the gate. Queueing work now
clears the flag.

Co-authored-by: rmcrackan <rmcrackan@gmail.com>
This commit is contained in:
Cursor Agent
2026-08-14 18:11:03 +00:00
parent 3129221531
commit b35276c7a1

View File

@@ -104,8 +104,7 @@ public class ProcessQueueViewModel : ReactiveObject
RaisePropertyChanged(nameof(Progress));
}
private void ProcessBook_LogWritten(object? sender, string logMessage)
=> Invoke(() => LogEntries.Add(new(DateTime.Now, logMessage.Trim())));
private void ProcessBook_LogWritten(object? sender, string logMessage) => AddQueueLogEntry(logMessage);
private void AddQueueLogEntry(string logMessage)
=> Invoke(() => LogEntries.Add(new(DateTime.Now, logMessage.Trim())));
@@ -357,6 +356,10 @@ public class ProcessQueueViewModel : ReactiveObject
private void AddToQueue(IList<ProcessBookViewModel> pbook)
{
// Queueing more work withdraws an earlier Cancel All, which may still be settling on the book it
// cancelled. Otherwise these new books would inherit that cancellation at the daily-limit gate.
cancelAllRequested = false;
foreach (var book in pbook)
book.LogWritten += ProcessBook_LogWritten;