From 75403276895c0bdeb1a25100528d1519dd2b4940 Mon Sep 17 00:00:00 2001 From: Kevin L'Hereec Date: Mon, 8 Jun 2026 14:13:09 +0000 Subject: [PATCH] fix: process GPN response in DiscoveringParametersState MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GPN response (ParameterInfoStruct list) was received but never processed — organizeParameters() was never called, so discovered parameters were lost and gpnStatus was never set to 'supported'. Now on each successful GPN response: - device.organizeParameters() is called to store leaf params/props - device.setGpnStatus('supported') marks the device as GPN-capable This fixes: parameters not showing in UI, wrong dataModel detection, and PeriodicInformInterval not appearing after SPV. Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- app/services/cwmp/main_state_machine.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/services/cwmp/main_state_machine.ts b/app/services/cwmp/main_state_machine.ts index eab9155..f4bf9f3 100644 --- a/app/services/cwmp/main_state_machine.ts +++ b/app/services/cwmp/main_state_machine.ts @@ -130,7 +130,21 @@ class DiscoveringParametersState extends DeviceState { return { nextState: new CriticalReadsState(), response: '' } } - // Process response and continue + // GPN success — process the response + if (context.message?.success && context.message.data) { + try { + context.device.organizeParameters(context.message.data, new Date()) + context.device.setGpnStatus('supported') + logger.info( + { deviceId: context.device.identifier, paramCount: context.device.getParameters().length }, + '[DiscoveringParameters] GPN response processed' + ) + } catch (e: any) { + logger.error({ error: e?.message }, '[DiscoveringParameters] Error processing GPN response') + } + } + + // Continue with next path in queue if any if (this.parameterQueue.length > 0) { return { response: await this.processNext(context) } }