A small service builds a summary from incoming codes and supports cancellation during processing. It now works almost correctly, but in some scenarios the final counters and cancellation behavior diverge from what is expected.
BuildAsync accepts a snapshot of the input strings, a CancellationToken, and a delay between items.Trim() and case-insensitively.OperationCanceledException.Accepted, Skipped, and Processed.BuildAsync:[" A1 ", "a1", "", "B2"]
Accepted is 2, Skipped is 2, and Processed is 4.BuildAsync stops waiting and does not return a successful result.dotnet test in normal modeUse line comments to explain the problem, its impact, the fix and how to test it.