Skip to content

fix: chunk 3 — link and roster lifecycle, HID #132

Closed

Description

@mottihoresh

Part of the fix track (parent issue linked in the sidebar). These items change behaviour on purpose; each final answer was decided on 2026-10-16. The test checklist at the bottom is one hardware session: plugging and unplugging, a reflash, a reload, and a longer soak.

Owners: gateway/gateway-connection.ts, nodes/node-hub.ts (roster poll + GatewayWatch), nodes/node-model.ts, hid/hid-service.ts, hid/calibration/*, app/ipc.ts (rehydrate).

Item Today After
M2 + G1 roster requests and the not-responding deadline Each roster request (5 s poll, reconnect, Refresh) throws away replies still arriving, so those boards are marked offline. The poll interval equals the not-responding deadline, so one lost reply can flash "Gateway not responding" A pending-request generation, so a new request never discards an arriving reply. The poll cadence and the not-responding deadline are designed together (e.g. re-ask once inside the window), so one lost reply never trips the alert
M4 stopped serial bridge Callbacks from a stopped bridge still drive the link; after Disconnect/Retry an orphan can reopen the port and hold it Callbacks from a bridge that isn't current are ignored; stopped is re-checked after each await
M7 retry saves last seen The error → Retry path resets without saving last seen Reset saves last seen first
M3 v2 bridge END With a v2 bridge the END line still completes the roster, so every board reads offline END is no longer reconciled after the v2 warning
X2 / R5 / S10 on the bus Fresh PDU telemetry shows a board but doesn't count it as online; while unplugged, the Cockpit's "New on the bus" and About's "on the bus" treat the stale roster as live Fresh telemetry counts as online; every "on the bus" surface goes quiet while the link is down
N7 HID availability — Dropped (user 2026-10-17): the hat/button list is the client's synced copy of HIDControls.h, not read from the device; axes already follow the device on every connect; a mismatched reflash isn't a realistic case
N1 reload A window reload drops the recording, replay file, serial-monitor flag, aircraft, telemetry, peak W and link-down time The rehydrate bundle carries them
N6 calibrate badge The per-axis badge opens calibration with the link down while the Calibrate button is disabled The badge follows the button's link rule
NEW (user 2026-10-17) remove Refresh Connection › Connected nodes has a Refresh button that asks for the roster now; the 5 s poll and every reconnect already do Remove the button and everything only it uses: the nodes:refresh intent (contract, preload, IPC_ORDER, API guard), the store intent, the canRefresh fact on device:status. The poll and reconnect requests stay. Update the design board's Connection board too
X11 NACK names Two NACK-name functions (5 reachable vs all) One nackName() from the synced firmware table

Tests that change on purpose: the GatewayWatch G1 mechanics test (gateway-health "counts from the oldest unanswered request").

Hardware test (one session)

  • 30+ min soak with two panel groups + a PDU: no false offline/online rows, no "Gateway not responding" flash
  • Disconnect → Connect and Retry repeatedly: the port is never left locked; last seen is saved each time
  • Unplug the Gateway: "New on the bus" and Settings › About go quiet; plug back in: they return
  • Reload the window (dev) while recording/replaying: the recording, replay, monitor flag, aircraft and gauges are still shown
  • With the link down, an axis badge doesn't open calibration
  • Connection › Connected nodes has no Refresh button; boards still update on their own

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions