fix: avoid GPN on root path Device. which returns the full parameter tree
Build & Deploy / build (push) Successful in 33s
Build & Deploy / docker (push) Successful in 57s
Build & Deploy / deploy (push) Successful in 33s

Two complementary fixes:
- IdleState: skip root-level parent paths (Device., InternetGatewayDevice.)
  when building the GPN queue. Params like Device.RootDataModelVersion have
  Device. as parent but sending GPN on Device. with NextLevel=0 returns the
  entire TR-181 tree in one response (potentially several MB).
  These root-level params are classified via deeper subtree GPN or catalog.
- task_queue: use NextLevel=1 for root paths (1 segment) as a safety net,
  NextLevel=0 for deeper paths to get all leaves of that subtree.
This commit is contained in:
Kevin L'Hereec committed 2026-07-17 16:29:29 +02:00
1 parent cce14d7039
commit 26ffcbea6b
2 files changed
+16 -4

No files matched your search

+6 -1
View File
@@ -40,7 +40,12 @@ export enum TaskStatus {
export class CWMPTaskQueue extends EventEmitter {
static task_map: Record<string, (props: any) => string> = {
get_parameter_names: (parameterPath: string) => {
return CWMPMessageBuilder.getParameterNames(undefined, parameterPath, false)
// Use NextLevel=1 for root paths (e.g. "Device." or "InternetGatewayDevice.")
// to avoid fetching the entire parameter tree in a single response.
// For deeper paths (e.g. "Device.DeviceInfo.") use NextLevel=0 to get all leaves.
const segments = parameterPath.replace(/\.$/, '').split('.')
const nextLevel = segments.length <= 1
return CWMPMessageBuilder.getParameterNames(undefined, parameterPath, nextLevel)
},
get_parameter_attributes: (parameterNames: string[]) => {
return CWMPMessageBuilder.getParameterAttributes(undefined, parameterNames)