Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lineage #2266

Closed
RunDevelopment opened this issue Oct 14, 2023 · 0 comments · Fixed by #2494
Closed

Fix lineage #2266

RunDevelopment opened this issue Oct 14, 2023 · 0 comments · Fixed by #2494

Comments

@RunDevelopment
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant