Summary
Follow-up to #757. Fixes #949.
Four catches in the automatic search loop excluded OperationCanceledException. I checked each one against current canary and changed three, as agreed in the issue.
Changes
Fixed
- Both
SearchProgressdebug broadcasts inAutomaticSearchProcessor.ProcessAudiobookAsyncnow contain anOperationCanceledExceptionthat is not the host stopping (a timeout surfaces asTaskCanceledException). Before, it aborted the book before scoring or submission. A cancellation with the stopping token cancelled still propagates.
Changed
- A timeout out of the download-client submission now logs a warning that names the submission step, then rethrows. The per-book handler still skips the
LastSearchTimewrite, so the book is retried next cycle and not after the cooldown. Behaviour is the same as before; only the log attribution is new.
Not changed: the catch in SearchResultScorer. GetByIdAsync is called without a token there, so nothing cancellable sits under it.
Testing
New AutomaticSearchProcessorCancellationTests, which drive the whole cycle through RunCycleAsync:
RunCycleAsync_BroadcastTimesOut_StillQueuesTheDownload(fails without the fix)RunCycleAsync_BroadcastCanceledByHostShutdown_StopsWithoutQueuingRunCycleAsync_DownloadClientTimesOut_RetriesTheBookNextCycle
The last two pass before and after. They pin the shutdown path and the next-cycle retry so a later change to these catches cannot lose either.
dotnet test --filter "FullyQualifiedName~Search|FullyQualifiedName~BackendArchitecture|FullyQualifiedName~WorkerProcessorBoundary": 1681 passed, 8 failed, 2 skipped. The 8 failures are the UnmatchedScanProcessor_* tests in WorkerProcessorBoundaryTests. They fail the same way on unmodified canary on my machine with PlatformNotSupportedException (macOS Arm64), so I expect CI to pass them.
dotnet format listenarr.slnx --no-restore --verify-no-changes is clean for t...
Automated Canary build