Xiao-zhen-Liu commented on code in PR #3836:
URL: https://github.com/apache/texera/pull/3836#discussion_r2417553407


##########
core/gui/src/app/workspace/service/workflow-graph/model/shared-model-change-handler.ts:
##########
@@ -153,9 +153,18 @@ export class SharedModelChangeHandler {
       event.changes.keys.forEach((change, key) => {
         if (change.action === "add") {
           const newLink = 
this.texeraGraph.sharedModel.operatorLinkMap.get(key) as OperatorLink;
-          const jointLinkCell = JointUIService.getJointLinkCell(newLink);
-          jointElementsToAdd.push(jointLinkCell);
-          linksToAdd.push(newLink);
+          // Validate the link first
+          try {
+            this.texeraGraph.assertLinkNotDuplicated(newLink);
+            this.texeraGraph.assertLinkIsValid(newLink);

Review Comment:
   Done. The message in the console is also updated without calling it an error:
   <img width="436" height="41" alt="image" 
src="https://github.com/user-attachments/assets/b1981aa4-f334-4bd7-9eb2-fa61fd8e545c";
 />
   



-- 
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]

Reply via email to