Skip to content

Commit 5242939

Browse files
carterscodeclaude
andcommitted
docs(monitor): the doc said unmonitored items must not be passed; the method filters them
The XML comment and the implementation disagreed. Filtering belongs in the method rather than at the call site, because the guarantee it protects -- the published set is the Status count, and that count is monitored settings only -- lives here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 30255ee commit 5242939

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/GamerGuardian/Services/MonitorService.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -533,13 +533,14 @@ private void Publish(Func<IReadOnlyDictionary<string, DriftItem>, Dictionary<str
533533
/// whatever the last poll published — reporting 0 for up to ten minutes after
534534
/// Verify had just said otherwise.</para>
535535
/// </summary>
536-
/// <param name="monitoredDrift">Drifted items that are monitored. Unmonitored
537-
/// settings must not be passed: the published set is what the Status count
538-
/// reports, and that count is defined as monitored settings only.</param>
539-
public void PublishManualScan(IEnumerable<DriftItem> monitoredDrift)
536+
/// <param name="drifted">Everything Verify found. Unmonitored items are filtered
537+
/// out here rather than at the call site: the published set is what the Status
538+
/// count reports, and that count is defined as monitored settings only, so the
539+
/// filter belongs with the guarantee.</param>
540+
public void PublishManualScan(IEnumerable<DriftItem> drifted)
540541
{
541-
var drifted = monitoredDrift.Where(d => d.IsMonitored).ToList();
542-
Publish(previous => MergeDrift(previous, tier: null, drifted, EmptyApplied));
542+
var monitored = drifted.Where(d => d.IsMonitored).ToList();
543+
Publish(previous => MergeDrift(previous, tier: null, monitored, EmptyApplied));
543544
}
544545

545546
private static readonly IReadOnlySet<string> EmptyApplied =

0 commit comments

Comments
 (0)