@noatgnu/cupcake-vanilla 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3896,7 +3896,9 @@ class AsyncTaskUIService {
3896
3896
  tasks$ = this.tasksSubject.asObservable();
3897
3897
  activeTasks$ = this.tasks$.pipe(map(tasks => {
3898
3898
  const taskArray = Array.isArray(tasks) ? tasks : [];
3899
- return taskArray.filter(task => task.status === TaskStatus.QUEUED || task.status === TaskStatus.STARTED);
3899
+ const active = taskArray.filter(task => task.status === TaskStatus.QUEUED || task.status === TaskStatus.STARTED);
3900
+ console.log('AsyncTaskUIService: activeTasks$ emitting:', active.length, 'active tasks out of', taskArray.length, 'total');
3901
+ return active;
3900
3902
  }));
3901
3903
  metadataTableRefresh$ = this.metadataTableRefreshSubject.asObservable();
3902
3904
  taskCompleted$ = this.taskCompletedSubject.asObservable();
@@ -4027,9 +4029,12 @@ class AsyncTaskUIService {
4027
4029
  }));
4028
4030
  }
4029
4031
  handleTaskUpdate(message) {
4032
+ console.log('AsyncTaskUIService: handleTaskUpdate called with message:', message);
4030
4033
  const taskId = message.task_id;
4031
4034
  const currentTasks = this.tasksSubject.value;
4035
+ console.log('AsyncTaskUIService: Current tasks in subject:', currentTasks.length);
4032
4036
  const existingTaskIndex = currentTasks.findIndex(t => t.id === taskId);
4037
+ console.log('AsyncTaskUIService: Existing task index:', existingTaskIndex);
4033
4038
  if (existingTaskIndex >= 0) {
4034
4039
  const existingTask = currentTasks[existingTaskIndex];
4035
4040
  const wasRunning = existingTask.status === TaskStatus.QUEUED || existingTask.status === TaskStatus.STARTED;
@@ -4043,6 +4048,7 @@ class AsyncTaskUIService {
4043
4048
  };
4044
4049
  const updatedTasks = [...currentTasks];
4045
4050
  updatedTasks[existingTaskIndex] = updatedTask;
4051
+ console.log('AsyncTaskUIService: Emitting updated tasks:', updatedTasks.length, 'active tasks:', updatedTasks.filter(t => t.status === TaskStatus.QUEUED || t.status === TaskStatus.STARTED).length);
4046
4052
  this.tasksSubject.next(updatedTasks);
4047
4053
  if (message.status === TaskStatus.STARTED) {
4048
4054
  this.showTaskProgressNotification(updatedTask, existingTask);
@@ -4072,10 +4078,13 @@ class AsyncTaskUIService {
4072
4078
  }
4073
4079
  }
4074
4080
  else {
4081
+ console.log('AsyncTaskUIService: Task not found in current list, fetching all tasks');
4075
4082
  this.getTasks().subscribe(tasks => {
4076
4083
  const taskArray = Array.isArray(tasks) ? tasks : [];
4084
+ console.log('AsyncTaskUIService: Fetched tasks from server:', taskArray.length);
4077
4085
  this.tasksSubject.next(taskArray);
4078
4086
  const refreshedTask = taskArray.find(t => t.id === taskId);
4087
+ console.log('AsyncTaskUIService: Found refreshed task:', refreshedTask ? refreshedTask.id : 'not found');
4079
4088
  if (refreshedTask && (message.status === TaskStatus.SUCCESS || message.status === TaskStatus.FAILURE || message.status === TaskStatus.CANCELLED)) {
4080
4089
  this.showTaskCompletionNotification(refreshedTask);
4081
4090
  const isTaskFromThisTab = this.isTaskInitiatedByThisTab(refreshedTask.id);