Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix(store): add project filter to task_run lateral join in listTasksImpl (#19760)

boojack837a9c931d3e
diff --git a/backend/store/task.go b/backend/store/task.go
index 18d21fe7ab..d3c3d35c5e 100644
--- a/backend/store/task.go
+++ b/backend/store/task.go
@@ -279,7 +279,7 @@ func (*Store) listTasksImpl(ctx context.Context, txn *sql.Tx, find *TaskFind) ([
task_run.updated_at,
task_run.run_at
FROM task_run
- WHERE task_run.task_id = task.id
+ WHERE task_run.project = task.project AND task_run.task_id = task.id
ORDER BY task_run.id DESC
LIMIT 1
) AS latest_task_run ON TRUE