Copilot commented on code in PR #8581:
URL: https://github.com/apache/texera/pull/8581#discussion_r4065666687
##########
frontend/src/app/workspace/service/execute-workflow/execute-workflow.service.ts:
##########
@@ -95,6 +95,8 @@ export class ExecuteWorkflowService {
// TODO: move this to another service, or redesign how this
// information is stored on the frontend.
private assignedWorkerIds: Map<string, readonly string[]> = new Map();
+ /** The last duration the backend reported for the current run; see
getExecutionDuration. */
+ private executionDuration = 0;
Review Comment:
This cache is never cleared by either `resetExecutionState()` or
`resetExecutionAndWorkers()`. After leaving a completed workflow (or starting
another run), the root service still returns the previous run's duration; the
next workflow's menu displays that stale time and the Form View shows a nonzero
clock while idle. Reset the cached duration whenever execution/session state is
reset, and cover the reset path in the service spec.
##########
frontend/src/app/workspace/service/execute-workflow/execute-workflow.service.ts:
##########
@@ -194,6 +202,30 @@ export class ExecuteWorkflowService {
return this.currentState;
}
+ /** How long the current run has been going, for a view that mounted after
it started. */
+ public getExecutionDuration(): number {
+ return this.executionDuration;
Review Comment:
The cached value does not restore a live mid-run clock. The backend emits
this event only when start/end timestamps change, while both UI timers start
only inside their `ExecutionDurationUpdateEvent` subscriptions. After a routed
handoff, `getExecutionDuration()` therefore returns the old start-event
baseline and the new view never increments it until the run ends. Preserve the
event's running state/timestamp and expose a replaying/ticking duration, or
explicitly restart each consumer's timer from the retained execution state.
--
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]