chenlica commented on code in PR #3836:
URL: https://github.com/apache/texera/pull/3836#discussion_r2418411835
##########
core/gui/src/app/workspace/service/workflow-graph/model/shared-model-change-handler.ts:
##########
@@ -200,6 +203,33 @@ export class SharedModelChangeHandler {
});
}
+ /**
+ * Check the sanity of a newly added link. We have constraints on a new link
(it should connect to operators and
+ * ports that exist, and it should not be duplicated with another link
connecting to the same operator ports.) Such
+ * constraints are enforced if the change to the shared model comes from
local UI (`WorkflowGraph.addLink()`). If
+ * the change is initiated by the `UndoManager` or from remote
collaborators, however, due to the limitations of Yjs,
+ * it is not possible to check the sanity of this operation before it is
applied to the shared model. To ensure the
+ * integrity of the shared model, we validate the link add operation here
instead, and repair the shared model if it
+ * violates the constraints.
+ * @param newLink A new link that has already been added to the shared model
+ * @returns Whether this new link passes the sanity check. If it does, this
change can be applied to the UI. Otherwise
+ * this link is already deleted from the shared model.
+ */
+ private validateAndRepairNewLink(newLink: OperatorLink): boolean {
Review Comment:
OK. I will approve it shortly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]