Skip to content

Reconcile matches by recency only — concurrent commissions can mis-attribute names #22

Description

@simons-plugins

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

Problem

reconcile_node_added matches a late-joining node to a timed-out job purely by recency — the docstring acknowledges it (commission_jobs.py:236-240: "matched by recency … the most recent one wins (a single rehearsal/retry flow never has two)"), and the claim is candidates[-1] at commission_jobs.py:260.

Two consequences:

  1. Two jobs time out inside RECONCILE_WINDOW (commission_jobs.py:63, 5 min): when node X joins it is claimed by the most recent job regardless of which device it actually is — the wrong suggestedName/suggestedRoom get applied and the wrong jobId reports success.
  2. Any unrelated node_added within the window (e.g. a node added from the matter-server dashboard or another controller) flips a timed-out job to success with the wrong nodeId in its result.

There is no identity check (discriminator, vendor/product from the node payload) tying the node to the job.

Status

Acceptable for v1: Domio commissions strictly one device at a time, so two in-window timeouts don't occur in practice. Revisit if Domio ever parallelizes commissioning — candidate fix is matching on the job's stored discriminator (already on the Job dataclass) against the joining node's descriptor data.

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