Commit Graph
1 Commits
  • fix(nodes): let a master's push and reconcile converge node inbounds
    Invariant: every inbound the master holds for a node, with its clients and
    enable flag, converges onto that node at the next push or reconcile.
    
    823db059 made an inbound save keep the stored clients and enable unless the
    request is a master push, recognised only by a node-sync token scope. Nodes
    are usually enrolled with an admin token (the -getApiToken and install
    default), so their nodes treated every master push as a stale form save:
    clients attached on the master (Attach existing clients, bulk attach above
    the per-client threshold, any dirty-node reconcile) never reached the node,
    yet the push was recorded as successful so reconcile stopped retrying.
    Remote now marks every request with X-3x-Master-Push, and the node honours
    it like the node-sync scope. The browser form never sends it, so the
    stale-form protection for panel saves and plain API scripts is unchanged.
    
    Separately, an inbound deleted on the node kept its tag->id in the
    master's cache, so reconcile sent update/<deleted id> forever instead of
    re-creating it. When the node reports no form of the tag, ReconcileInbound
    now drops the cached id so the resolve re-reads the node and falls back to
    add. Two runtime tests pinned the old update-to-cached-id path for an
    absent inbound; they now count the add, or report the inbound present.