From 08c620ee68c5bad2bec44d88aa568a7cb0b5a52d Mon Sep 17 00:00:00 2001 From: Kevin L'Hereec Date: Mon, 8 Jun 2026 14:20:59 +0000 Subject: [PATCH] fix: drain task queue on session completion to stop orphan CWMP requests After OperationalState, the state machine was marked completed but leftover tasks in the CWMPTaskQueue (queued by ConfigurationEvaluationState callbacks) were being served to the CPE on subsequent empty POSTs via the continue() task fallback path, causing spurious GetParameterNames + SetParameterValues exchanges after the session officially ended. Fix: call taskQueue.clearPendingTasksForDevice() in completeMachine() so no tasks bleed into the next session. Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- app/services/cwmp/state_machine_manager.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/cwmp/state_machine_manager.ts b/app/services/cwmp/state_machine_manager.ts index be7dd55..53a1038 100644 --- a/app/services/cwmp/state_machine_manager.ts +++ b/app/services/cwmp/state_machine_manager.ts @@ -434,6 +434,8 @@ export class StateMachineManager extends EventEmitter { const deviceKey = JSON.stringify(machine.deviceId) this.deviceSessions.delete(deviceKey) this.sessionMachines.delete(machine.session) + // Drain any leftover tasks so they don't bleed into the next session + this.taskQueue.clearPendingTasksForDevice(machine.deviceId) } private failMachine(machine: StateMachineInstance, error: string): void {