feat: TR-069 CWMP state machine hardening + exchange viewer improvements
- TR-069 CWMP state machine hardening (14 phases): shared event utility, multi-event routing, GPN circuit breaker, IdleState GPN guard, expanded GPN fault codes, CriticalReadsState, ConfigEval GPN guard, task queue race condition fix, explicit error handling, terminal states (OperationalState/PartialOperationalState), consolidated reclassify, crash pattern detection, removed enqueueImmediate, state flow wiring - Fix SOAP Fault not processed by state machine (soap-env:Fault detection) - Fix GPN circuit breaker not persisting after session drops - Fix CriticalReadsState GPV response parsing (xsi:type normalization) - Fix CriticalReadsState not processing GPV response values - Skip SPV when device is already compliant (ProvisioningCode check) - Add Device.DeviceInfo.ModelName to critical reads GPV - Fix TypeError on DeviceDetail parameters view (null guards) - Log empty 204 responses in exchange trace UI - TR-181 catalog: type corrections and new entries (+6640 lines) - SequenceViewer: replace session-nav buttons with compact dropdown select - SequenceViewer: fix CPE/ACS lifeline headers wrapping to 2 lines - Add 20 unit tests for state machine fixes (SOAP Fault, GPN circuit breaker, CriticalReads, stale session, ConfigEval/ComplianceUpdate skips) Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev>
This commit is contained in:
1 parent
dabe15839d
commit
aad93911e4
35 files changed
+8593
-4497
No files matched your search
@@ -42,10 +42,13 @@ export default class CwmpLoggerMiddleware {
|
||||
const sessionId = `${remoteIp}:${remotePort}->${localAddress}:${localPort}`
|
||||
|
||||
let capturedResponseXml: string | null = null
|
||||
let isEmptyResponse = false
|
||||
const originalSend = response.send.bind(response)
|
||||
response.send = (body: any) => {
|
||||
if (typeof body === 'string' && body.includes('soap-env:Envelope')) {
|
||||
capturedResponseXml = body
|
||||
} else if (!body || (typeof body === 'string' && body.trim() === '')) {
|
||||
isEmptyResponse = true
|
||||
}
|
||||
return originalSend(body)
|
||||
}
|
||||
@@ -77,6 +80,13 @@ export default class CwmpLoggerMiddleware {
|
||||
sessionId,
|
||||
rawXml: capturedResponseXml,
|
||||
}).catch(() => {})
|
||||
} else if (isEmptyResponse) {
|
||||
exchangeStore.persistExchange({
|
||||
deviceId,
|
||||
direction: 'ACS→CPE',
|
||||
sessionId,
|
||||
rawXml: '',
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
// Old system: file-based writes (kept for Phase 1 dual-write rollback safety)
|
||||
|
||||
Reference in new issue
Block a user