fix: reject malformed Zigbee topology replies

Issue: #54
User-Visible: no
This commit is contained in:
Sergey Matyunin
2026-09-04 15:26:06 +03:00
parent aab5c3ca95
commit 4203a01b04
27 changed files with 238 additions and 189 deletions
+11
View File
@@ -5640,6 +5640,17 @@ const MUTANT_DEFINITIONS = [
replace: ' if (value) responseResolve?.(value);',
}],
},
{
id: 'zigbee-topology-z2m-malformed-response-waits-for-timeout',
guard: 'node --test --test-name-pattern="malformed response immediately" test/zigbee-topology.test.mjs',
because: 'a malformed response on the subscribed network-map topic must report invalid payload '
+ 'immediately instead of leaving the settings dialog loading for the full timeout (#54 AC16)',
patches: [{
file: 'src/zigbee-topology-runtime.ts',
find: " if (value === null) {\n if (responseActive) responseReject?.(fail('invalid_payload'));\n return;\n }",
replace: ' if (value === null) return;',
}],
},
{
id: 'zigbee-topology-z2m-subscriptions-leak',
guard: 'node --test test/zigbee-topology.test.mjs',