Commit 63a53c7
fix: refuse two children of one parent sharing an id
The same defect as the ancestor guard, one step sideways, and equally
silent. Two children of one parent with the same id derive the same base
topic, so their $description publishes overwrite each other on the broker
and whichever wrote last defines the device; the parent meanwhile names
that child twice in its own `children` list, which is malformed.
Observed before the guard:
children_ids() : ['circuit-1', 'circuit-1']
a's nodes : ['meter']
b's nodes : ['switch']
...both retained at : ebus/5/circuit-1/$description
Costs no new state: the parent already tracks its children, so this is a
scan of parent.children() on a construction that already walks the
ancestor chain. delete() detaches a child, so recreating one after
deleting it is not a false positive, and DeviceTreeBuilder.add() already
handles re-fired lifecycles at its own level.
Refs #67
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 5a0a733 commit 63a53c7
3 files changed
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1564 | 1564 | | |
1565 | 1565 | | |
1566 | 1566 | | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
1567 | 1577 | | |
1568 | 1578 | | |
1569 | 1579 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3074 | 3074 | | |
3075 | 3075 | | |
3076 | 3076 | | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
0 commit comments