kunwp1 commented on code in PR #5565:
URL: https://github.com/apache/texera/pull/5565#discussion_r3379336555


##########
frontend/src/app/workspace/service/workflow-result/workflow-result.service.ts:
##########
@@ -95,6 +95,17 @@ export class WorkflowResultService {
     return this.operatorResultServices.get(operatorID);
   }
 
+  /**
+   * Drop cached operator results and reset table stats so a re-entered 
workflow
+   * doesn't show stale results. resultTableStats is a ReplaySubject, so
+   * reset it to an empty snapshot to avoid replaying stale stats to 
subscribers.
+   */
+  public clearResults(): void {
+    this.operatorResultServices.clear();
+    this.paginatedResultServices.clear();
+    this.resultTableStats.next({});
+  }

Review Comment:
   Done in cb93c7156. A plain rerender signal isn't enough here: 
`rerenderResultPanel()` only clears frames when the highlighted operator 
changes, so an operator that stays highlighted across a unit switch would keep 
its stale frame. `clearResults()` now emits a dedicated `resultClearedStream`, 
and `ResultPanelComponent` subscribes to tear down the stale result/console 
frames (clears the panel and resets the selected operator). Covered by a new 
`WorkflowResultService` test.



##########
frontend/src/app/workspace/service/execute-workflow/execute-workflow.service.ts:
##########
@@ -354,6 +354,15 @@ export class ExecuteWorkflowService {
     };
   }
 
+  /**
+   * Reset execution status and worker assignments. Unlike 
resetExecutionState(),
+   * which resets only the status, this also clears the worker assignments.
+   */
+  public resetExecutionAndWorkers(): void {
+    this.resetExecutionState();
+    this.assignedWorkerIds.clear();
+  }

Review Comment:
   Done in cb93c7156. `resetExecutionAndWorkers()` now goes through 
`updateExecutionState({ state: Uninitialized })` instead of 
`resetExecutionState()`, so the reset is broadcast on `executionStateStream` 
and `MenuComponent`/`ResultPanelComponent` drop the previous unit's status. The 
spec now asserts the stream emits.



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