Skip GPN test and catalog reclassification when device is already classified. IdleState skips GPN if gpnStatus=supported AND parameters exist. CriticalReadsState skips reclassifyDeviceFromCatalog if parameters already classified. Avoids unnecessary RPCs on subsequent sessions. All 809 tests pass. Build status: Success
This commit is contained in:
1 parent
6e3974531c
commit
ffbed94dcc
1 file changed
+12
-1
@@ -54,6 +54,15 @@ class IdleState extends DeviceState {
|
||||
return { nextState: new CriticalReadsState(), response: '' }
|
||||
}
|
||||
|
||||
// If device is already classified (GPN supported + has parameters), skip GPN test
|
||||
if (device.gpnStatus === 'supported' && device.getParameters().length > 0) {
|
||||
logger.info(
|
||||
{ gpnStatus: device.gpnStatus, paramCount: device.getParameters().length, deviceId: device.identifier },
|
||||
'[IdleState] Device already classified — skipping GPN test'
|
||||
)
|
||||
return { nextState: new CriticalReadsState(), response: '' }
|
||||
}
|
||||
|
||||
logger.info(
|
||||
{ gpnStatus: device.gpnStatus, circuitBreaker: device.gpnCircuitBreaker, deviceId: device.identifier },
|
||||
'[IdleState] GPN allowed — proceeding to discovery'
|
||||
@@ -239,7 +248,9 @@ class CriticalReadsState extends DeviceState {
|
||||
}
|
||||
}
|
||||
|
||||
if (context.device.gpnStatus !== 'supported') {
|
||||
// Only reclassify via catalog if GPN is not supported AND device hasn't been classified yet
|
||||
// (i.e., no parameters exist — all are still stored as properties)
|
||||
if (context.device.gpnStatus !== 'supported' && context.device.getParameters().length === 0) {
|
||||
reclassifyDeviceFromCatalog(context.device)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user