The PR below shows changes in a service that merges member tags into a shared registry and returns a short processing summary. After the changes, the behavior started to differ from the expected one: some valid tags do not make it into the final result, and a repeated call with the same input data produces a different summary.
MergeAsync method accepts a set of tags as IEnumerable<string>.Trim().Processed field must reflect the number of tags that were actually added to the shared registry in this call.Skipped field must reflect the number of input elements that were not added in this call.[" Admin ", "admin", "TEAM"]
It is expected that 2 tags will be added and one element will be counted as skipped.
First call: ["news"]
Second call: ["news"]
In the second call, the tag must not be counted as processed again.
Skipped.MemberTagRegistry instance is used..NET 8.0C# 12Task-based async without parallel processingSystem, System.Collections.Generic, System.Linq, System.Threading, System.Threading.TasksMemberTagRegistry.MergeAsync(IEnumerable<string> tags, CancellationToken cancellationToken = default)TagMergeSummary(int Processed, int Skipped)Use line comments to explain the problem, its impact, the fix and how to test it.