diff --git a/crates/turbo-tasks-memory/src/memory_backend.rs b/crates/turbo-tasks-memory/src/memory_backend.rs index 404a43f5a7a08..624f6fe764e50 100644 --- a/crates/turbo-tasks-memory/src/memory_backend.rs +++ b/crates/turbo-tasks-memory/src/memory_backend.rs @@ -471,6 +471,7 @@ impl Backend for MemoryBackend { reader: TaskId, turbo_tasks: &dyn TurboTasksBackendApi, ) -> AutoMap { + Task::add_dependency_to_current(TaskEdge::Collectibles(id, trait_id)); Task::read_collectibles(id, trait_id, reader, self, turbo_tasks) } diff --git a/crates/turbo-tasks/src/manager.rs b/crates/turbo-tasks/src/manager.rs index 3ee524950bd1f..d6ff7ee10dfc7 100644 --- a/crates/turbo-tasks/src/manager.rs +++ b/crates/turbo-tasks/src/manager.rs @@ -523,13 +523,16 @@ impl TurboTasks { }); this.backend.task_execution_result(task_id, result, &*this); let stateful = this.finish_current_task_state(); - this.backend.task_execution_completed( + let schedule_again = this.backend.task_execution_completed( task_id, duration, memory_usage, stateful, &*this, - ) + ); + // task_execution_completed might need to notify tasks + this.notify_scheduled_tasks(); + schedule_again } .instrument(span) .await