Skip to content

Fix lineage #2266

@RunDevelopment

Description

@RunDevelopment

The current way the frontend handles lineage is incorrect. Fixing lineage will require #2258 because of collector.

How lineage affects connectability is described by this pseudocode:

let sourceL = getLineage(sourceNode);
if (isIterator(targetNode)) {
  // the inputs of iterator nodes only allow non-iterator connections
  return sourceL === undefined ? CONNECTABLE : INVALID;
}
if (isRegularNode(targetNode)) {
  if (sourceL === undefined) return CONNECTABLE;
  let targetL = getLineage(targetNode, excluded=targetInput)
  return targetL === undefined || targetL === sourceL ? CONNECTABLE : INVALID;
}
assert(isCollector(targetNode));
if (isIteratorInput(targetInput)) {
  if (sourceL === undefined) return INVALID;
  let targetL = getLineage(targetNode.iteratorInputs, excluded=targetInput)
  return targetL === undefined || targetL === sourceL ? CONNECTABLE : INVALID;
} else {
  // the non-iterator inputs of collector nodes only allow non-iterator connections
  return sourceL === undefined ? CONNECTABLE : INVALID;
}

Original discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions