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
@@ -36,21 +36,22 @@ describe('CWMPTaskQueue', () => {
|
||||
|
||||
describe('addTask', () => {
|
||||
it('adds task, marks as SENT, and returns SOAP XML', () => {
|
||||
const xml = queue.addTask(makeDeviceId(), 'reboot', { commandKey: 'test' }, async () => '')
|
||||
expect(xml).toContain('Reboot')
|
||||
expect(xml).toContain('test')
|
||||
const result = queue.addTask(makeDeviceId(), 'reboot', { commandKey: 'test' }, async () => '')
|
||||
expect(result.xml).toContain('Reboot')
|
||||
expect(result.xml).toContain('test')
|
||||
expect(result.taskId).toBeDefined()
|
||||
})
|
||||
|
||||
it('returns empty string for unknown task type', () => {
|
||||
const xml = queue.addTask(makeDeviceId(), 'unknown_type', {}, async () => '')
|
||||
expect(xml).toBe('')
|
||||
const result = queue.addTask(makeDeviceId(), 'unknown_type', {}, async () => '')
|
||||
expect(result.xml).toBe('')
|
||||
})
|
||||
|
||||
it('emits taskSent event', () => {
|
||||
it('does not emit taskSent event (race condition fix)', () => {
|
||||
let sent = false
|
||||
queue.on('taskSent', () => { sent = true })
|
||||
queue.addTask(makeDeviceId(), 'factory_reset', {}, async () => '')
|
||||
expect(sent).toBe(true)
|
||||
expect(sent).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user