Skip to content

fix(node): log peer cluster structure changes at info, not warn#4081

Merged
mergify[bot] merged 2 commits into
mainfrom
fix/peer-cluster-change-loglevel
Jul 13, 2026
Merged

fix(node): log peer cluster structure changes at info, not warn#4081
mergify[bot] merged 2 commits into
mainfrom
fix/peer-cluster-change-loglevel

Conversation

@Apollon77

Copy link
Copy Markdown
Collaborator

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 WARN per affected cluster:

WARN BehaviorBacking The cluster for active behavior server-1-fff1.@1:44c.basicInformation may no longer be strictly compatible with local implementation
WARN BehaviorBacking The cluster for active behavior server-1-fff1.@1:44c.networkCommissioning ...
...

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

  • Peer-only. Only reached from the client/peer context type swap.
  • Data is current. The changed data version already forced a full wildcard re-read, so both the regenerated behavior type (schema) and its values are up to date after the swap — there is no genuine staleness.
  • Consumers are notified. The change is signalled to upper layers via EndpointLifecycle.Change.ServersChanged (→ node_updated), so they can react.
  • Non-actionable & expected. Nothing for the operator to fix; routine on firmware upgrades. One WARN per cluster is pure noise.

Change

  • logger.warnlogger.info in the BehaviorBacking type setter.
  • Clearer message: Updated behavior <path> to match changed peer cluster structure.
  • Comment rewritten to state the invariant (re-read makes it current; reaches consumers via ServersChanged).

Verification

build, format-verify, lint, and packages/node tests (1447/1447) all pass.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings July 13, 2026 14:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from logger.warn to logger.info for 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.

@Apollon77 Apollon77 added the automerge Set this label if the PR is ready to automatically merged after approval label Jul 13, 2026
@mergify mergify Bot merged commit 48a038a into main Jul 13, 2026
44 checks passed
@mergify mergify Bot deleted the fix/peer-cluster-change-loglevel branch July 13, 2026 15:34
@mergify

mergify Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Set this label if the PR is ready to automatically merged after approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants