fix(node): log peer cluster structure changes at info, not warn#4081
Merged
Conversation
A peer's data-version change already forces a full re-read, so the regenerated behavior type and its values are current and the change reaches consumers via ServersChanged. This is expected on device firmware upgrades and is not a compatibility fault, so it should not surface as a warning. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces log noise in @matter/node when a peer device’s cluster structure changes (commonly after firmware upgrades), by downgrading a previously misleading compatibility WARN to an informational message while preserving the existing type-swap behavior.
Changes:
- Change
BehaviorBacking’s type-swap log fromlogger.warntologger.infofor peer-driven cluster structure updates. - Update the log text and inline comment to reflect that the post-swap data is already current and the change is surfaced via
ServersChanged. - Add a corresponding entry to the changelog under “WORK IN PROGRESS”.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/node/src/behavior/internal/BehaviorBacking.ts | Downgrades and clarifies logging when peer cluster-derived behavior types are swapped. |
| CHANGELOG.md | Documents the logging-level change for @matter/node in the WIP section. |
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
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.
Problem
When a paired peer changes its cluster structure — e.g. after a device firmware upgrade (Matter 1.2 → 1.4 in the reported case) — matter.js logs one
WARNper affected cluster:This is misleading. The
!type.supports(this.#type)check is a coarse JS-identity/prototype check, so it fires on any regenerated peer type, including fully-compatible additive changes.Why it's not a warning
EndpointLifecycle.Change.ServersChanged(→node_updated), so they can react.WARNper cluster is pure noise.Change
logger.warn→logger.infoin theBehaviorBackingtypesetter.Updated behavior <path> to match changed peer cluster structure.ServersChanged).Verification
build,format-verify,lint, andpackages/nodetests (1447/1447) all pass.🤖 Generated with Claude Code