fix(zigbee): restore observers after integration reload (#800)

Issue: #800
User-Visible: yes
This commit is contained in:
Matysh
2026-10-05 20:08:37 +03:00
parent 379de706d2
commit 4a7abf531b
19 changed files with 442 additions and 24 deletions
+1 -1
View File
@@ -4,5 +4,5 @@
"hostRefs": 5067,
"portPrivates": 103,
"harnessPrivates": 100,
"bundleBytes": 2686188
"bundleBytes": 2697519
}
+24
View File
@@ -9866,6 +9866,30 @@ const MUTANT_DEFINITIONS = [
replace: ' if (monotonic() - job.started) * 1000 < 0:',
}],
},
{
id: 'zigbee-background-scan-restores-ten-minute-deadline',
guard: 'node scripts/backend-test-guard.mjs issue_800_background_15_minutes_two_clients_and_reopen '
+ 'tests_backend/test_ha_zigbee_topology.py',
because: '#800 AC1: advancing the actual asyncio loop clock through 600 and 900 seconds '
+ 'must keep the server job waiting; the cancel threshold is not a scan deadline',
patches: [{
file: 'custom_components/houseplan/zigbee_topology.py',
find: ' await self.hass.loop.create_future()',
replace: ' async with asyncio.timeout(600):\n await self.hass.loop.create_future()',
}],
},
{
id: 'zigbee-background-unload-leaves-ui-waiting',
guard: 'node scripts/backend-test-guard.mjs issue_800_entry_unload_clears_jobs_and_new_entry_session_is_idle '
+ 'tests_backend/test_ha_zigbee_topology.py',
because: '#800 AC4/AC6: integration reload does not close HA WebSocket; existing observers '
+ 'must receive invalidation before their coordinator is discarded',
patches: [{
file: 'custom_components/houseplan/zigbee_topology.py',
find: ' self._emit({"kind": "closed", "session_id": self.session_id,\n "revision": self.revision})',
replace: ' pass # mutant: silently discard subscribers',
}],
},
{
id: 'touch-pinch-click-block-cleared-on-terminal',
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs '
+1 -2
View File
@@ -30,8 +30,7 @@
/** @type {SmokeLink[]} */
export const SMOKE_LINKS = [
{
files: ['src/zigbee-topology-runtime.ts', 'src/hp-zigbee-topology-settings.ts',
'custom_components/houseplan/zigbee_topology.py', 'custom_components/houseplan/zigbee_websocket.py'],
files: ['src/zigbee-topology-runtime.ts', 'src/hp-zigbee-topology-settings.ts'],
smokes: ['smoke_zigbee_topology_job.mjs'],
because: '#800: background-job restore across a real page reload, elapsed/cancel boundary, '
+ 'mounted UI lifecycle and mobile keyboard target are observed through the production '