Skip to content

feat(interaction): reassemble chunked list-attribute reports for cluster read - #101

Merged
p0fi merged 1 commit into
feat/98-tlv-optionalfrom
feat/96-list-chunk-reassembly
Sep 16, 2026
Merged

p0fi merged 1 commit into
feat/98-tlv-optionalfrom
feat/96-list-chunk-reassembly

Conversation

@p0fi

@p0fi p0fi commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Stacked on #100

This PR is stacked on #100 (tlv.Optional[T]) and targets that branch instead of main. Once #100 merges, GitHub will retarget this PR to main automatically.

Summary

  • Devices split a list attribute too large for one AttributeDataIB into an empty/partial-array marker followed by ListIndex=null "append" fragments; cluster read previously surfaced these as separate rows instead of one reassembled value.
  • Merges fragments into one AttributeReport per logical attribute inside internal/interaction.Client.Read, after its existing MoreChunkedMessages chunk-collection loop, operating on raw TLV bytes (no dependency on the clusters package).
  • Fragment contiguity (one attribute's fragments are never interleaved with another path's reports, even across message boundaries) was verified against the C++ reference implementation's reporting engine (Engine::BuildSingleReportDataAttributeReportIBs / AttributeEncodeState in connectedhomeip) before writing the merge algorithm.
  • A malformed sequence (an append fragment with no preceding whole-list marker) passes through as a single unmerged row rather than failing the whole read.
  • cli/cluster.go and internal/daemon are untouched — both already produce one row per report, so fewer, fully-merged reports from Client.Read fix cluster read for free.

Closes #96

Test plan

  • mise run test (table-driven tests in internal/interaction/reassemble_test.go with hand-built TLV fixtures, including a malformed-sequence case)
  • mise run lint
  • mise run build
  • Two-axis /code-review (Standards + Spec) run against this diff — no hard findings on either axis

🤖 Generated with Claude Code

…t.Read

Devices split a list attribute too large for one AttributeDataIB into an
empty/partial-array marker followed by ListIndex=null "append" fragments.
Merge these into one AttributeReport per logical attribute after the
existing MoreChunkedMessages loop collects the full response, so cluster
read always returns one row per attribute regardless of chunking. Fragment
contiguity (never interleaved with another path's reports) is verified
against the C++ reference implementation's reporting engine, which drains
one dirty path to exhaustion via AttributeEncodeState before moving to the
next. A malformed append with no preceding marker passes through unmerged
rather than failing the whole read.

Closes #96

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@p0fi
p0fi added this pull request to stack #102 September 16, 2026 20:40
@p0fi
p0fi merged commit d3212bb into main Sep 16, 2026
4 checks passed
@p0fi
p0fi deleted the feat/96-list-chunk-reassembly branch September 16, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reassemble chunked list-attribute reports for cluster read (Path.ListIndex)

1 participant