Skip to content

Late commission responses after the RPC timeout are dropped unlogged in _dispatch #23

Description

@simons-plugins

Surfaced during the PR #20 review (timeout/reconcile analysis).

Problem

MatterClient._request_frame (matter_client.py:193-203) pops the pending future in its finally once asyncio.wait_for expires. When matter-server eventually answers that message_id, _dispatch (matter_client.py:147-164) finds no future (self._pending.get(mid) → None) and silently drops the frame.

For most RPCs that's fine. For commission_with_code it loses real information:

  • A late success result is recoverable via the node_added reconcile path (Commission timeout race: job fails while matter-server completes the join #16), but the response drop leaves no trace for debugging.
  • A late FAILURE result is a definitive "this node will never join, and why" — it vanishes entirely while the timed-out job keeps telling Domio "the device may still join" (commission_jobs.py:65-68). The user waits out a reconcile window that can never pay off, with no evidence in the log.

Recommendation

Log unmatched responses in _dispatch: debug for plain unmatched results, warning when the frame carries an error payload (it represents a real failure someone gave up waiting for). Optionally, a late commission error could feed back into the job table to convert a commissioning_timeout into a definitive commissioning_failed.

Origin: analysis in #20

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions