From 13bf851ab59d4892e6d9f4f41af3316c22347fc2 Mon Sep 17 00:00:00 2001 From: lorentz Date: Thu, 16 Jul 2026 23:18:47 -0400 Subject: [PATCH] fix(23-06): wire auto_report webhook branch to autoPostAcknowledgment Replace the unguarded generateAndPostAcknowledgment(campaignId) direct call in runGatedPhishingStages' auto_report branch with the idempotent autoPostAcknowledgment(campaignId, 'system:auto_report'). Closes CR-01 (23-REVIEW.md) / Truth #18 (23-VERIFICATION.md): a repeat ticket-create webhook joining an already-acknowledged USER_AWARENESS campaign now finds the persisted remediation_actions row and skips the re-post instead of re-sending the customer-visible thank-you note on every additional report. --- lib/services/webhook-service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/webhook-service.ts b/lib/services/webhook-service.ts index cc49846..c7bc9b8 100644 --- a/lib/services/webhook-service.ts +++ b/lib/services/webhook-service.ts @@ -19,7 +19,7 @@ import { groupReportIntoCampaign } from './campaign-grouping-service'; import { getCompanyAutomationGate } from './phishing-automation-gate'; import { parseAndStoreMessage } from './phishing-eml-service'; import { classifyCampaign, Verdict } from './campaign-classifier'; -import { generateAndPostAcknowledgment } from './triage-note-service'; +import { autoPostAcknowledgment } from './remediation-service'; export class WebhookService { private _autotaskClient: AutotaskClient | null = null; @@ -558,7 +558,7 @@ export class WebhookService { } if (verdict === 'USER_AWARENESS') { - await generateAndPostAcknowledgment(campaignId); + await autoPostAcknowledgment(campaignId, 'system:auto_report'); } } catch (err) { console.error('[WEBHOOK] auto_report stage error', err);