Skip to content

Commit f9960a8

Browse files
committed
fix(webapp): route historical V1 cancel writes through the legacy run-ops handle
CancelTaskRunService.callV1 finalizes historical (engine V1) runs, which are legacy-resident. It wrote them through the control-plane client, which misses the row once legacy run-ops data lives on its own database. Route those two writes through runOpsLegacyPrisma, matching every other legacy run-graph write.
1 parent 939c007 commit f9960a8

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

apps/webapp/app/v3/services/cancelTaskRun.server.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { RunEngineVersion, type TaskRun } from "@trigger.dev/database";
2+
import { runOpsLegacyPrisma } from "~/db.server";
23
import { engine } from "../runEngine.server";
34
import { isCancellableRunStatus } from "../taskStatus";
45
import { BaseService } from "./baseService.server";
@@ -43,15 +44,17 @@ export class CancelTaskRunService extends BaseService {
4344
// DB row directly. Never throw here: the cancel route returns 500 on any throw.
4445
if (!isCancellableRunStatus(taskRun.status)) {
4546
if (options?.bulkActionId) {
46-
await this._prisma.taskRun.update({
47+
// runops-legacy-ok: bulk-action tag on a historical V1 run (legacy-resident)
48+
await runOpsLegacyPrisma.taskRun.update({
4749
where: { id: taskRun.id },
4850
data: { bulkActionGroupIds: { push: options.bulkActionId } },
4951
});
5052
}
5153
return { id: taskRun.id, alreadyFinished: true };
5254
}
5355

54-
await this._prisma.taskRun.update({
56+
// runops-legacy-ok: finalize (cancel) a historical V1 run (legacy-resident)
57+
await runOpsLegacyPrisma.taskRun.update({
5558
where: { id: taskRun.id },
5659
data: {
5760
status: "CANCELED",

0 commit comments

Comments
 (0)