fix: Node.delete_property() republishes $description - #41
Merged
Conversation
dcj
force-pushed
the
fix/delete-property-republishes-description
branch
from
August 7, 2026 14:31
4fe7b20 to
607d686
Compare
add_property() has always called publish_description(); its mirror never did. Deleting a property cleared the retained value topic but left the device in `ready` with a $description that still named the property, and nothing corrected it afterwards, so the broker held a self-contradicting device indefinitely. The two halves of the same API disagreed about whether mutating a node's property set is a structural change. It is. Deletions batch inside state_transition() exactly as additions do, so N deletions still collapse to one $description publish. Closes #35. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dcj
force-pushed
the
fix/delete-property-republishes-description
branch
from
August 7, 2026 14:31
607d686 to
eac0bf1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #35.
Node.add_property()has always calleddevice().publish_description(). Its mirrorNode.delete_property()never did: it cleared the property's retained value topic, removed it from the dict, logged, and returned.The result is a broker holding a device in
readywhose$descriptionstill names a property that no longer exists, permanently, with nothing to correct it. The two halves of the same API disagreed about whether mutating a node's property set counts as a structural change.Tests
test_delete_property_republishes_descriptionasserts a$descriptionis published and that the deleted property is absent from it while its sibling survives. Fails on main, passes here.test_delete_property_batches_inside_state_transitionpins the symmetry under batching: three deletions in one transition produce exactly one consolidated$description, the same guarantee additions already give.550 passed, ruff clean.Note on scope
Deliberately fixed rather than documented-as-required. Requiring callers to wrap a single
delete_property()in a transition, when the adding counterpart needs no such wrapper, would keep the asymmetry and just move it into the docs.