Yicong-Huang commented on code in PR #5702:
URL: https://github.com/apache/texera/pull/5702#discussion_r3411575613
##########
frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.ts:
##########
@@ -397,10 +397,14 @@ export class WorkflowEditorComponent implements OnInit,
AfterViewInit, OnDestroy
* Centralizing this here avoids the race where the validation pass
* overwrites a state-derived stroke (or vice versa) for an operator that
* is both invalid and has a cached execution status.
+ *
+ * Callers that already have a Validation result (the validation stream
+ * subscriber) may pass it in to avoid recomputing it; callers without one
+ * (the operator-add stream subscriber) let the helper fetch it lazily.
*/
- private applyOperatorBorder(operatorID: string): void {
- const validation =
this.validationWorkflowService.validateOperator(operatorID);
- if (!validation.isValid) {
+ private applyOperatorBorder(operatorID: string, validation?: Validation):
void {
+ const resolved = validation ??
this.validationWorkflowService.validateOperator(operatorID);
+ if (!resolved.isValid) {
this.jointUIService.changeOperatorColor(this.paper, operatorID, false);
return;
}
Review Comment:
Thanks!
--
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]