@@ -31,6 +31,7 @@ import type {
3131 ForWaitpointCompletionContext ,
3232 IdempotencyKeyRunMatch ,
3333 LatestExecutionSnapshotRead ,
34+ LockedRun ,
3435 LockRunData ,
3536 PromotePendingVersionArgs ,
3637 ReadClient ,
@@ -40,6 +41,7 @@ import type {
4041 StateHeldCheckpointInput ,
4142 TaskRunWithWaitpoint ,
4243} from "./types.js" ;
44+ import { lockedRunSelect } from "./types.js" ;
4345import { isReadReplicaClient } from "./readReplicaClient.js" ;
4446import type { TaskRunError } from "@trigger.dev/core/v3/schemas" ;
4547import type { ShardKey } from "@trigger.dev/core/v3/isomorphic" ;
@@ -1177,7 +1179,7 @@ export class PostgresRunStore implements RunStore {
11771179 runId : string ,
11781180 data : LockRunData ,
11791181 tx ?: PrismaClientOrTransaction
1180- ) : Promise < Prisma . TaskRunGetPayload < { } > > {
1182+ ) : Promise < LockedRun > {
11811183 // The run-lock update (with its nested PENDING_EXECUTING snapshot) and the completed-waitpoint
11821184 // connect must commit together, or a replica-served resume read can see the snapshot without its
11831185 // links and drop the resume.
@@ -1188,7 +1190,7 @@ export class PostgresRunStore implements RunStore {
11881190 runId : string ,
11891191 data : LockRunData ,
11901192 prisma : PrismaClientOrTransaction
1191- ) : Promise < Prisma . TaskRunGetPayload < { } > > {
1193+ ) : Promise < LockedRun > {
11921194 const dedicated = this . schemaVariant === "dedicated" ;
11931195
11941196 // Resolve the snapshot-write decision ONCE for both the nested snapshot below and the join-row
@@ -1240,6 +1242,7 @@ export class PostgresRunStore implements RunStore {
12401242 writesSnapshot
12411243 ) ,
12421244 } ,
1245+ select : lockedRunSelect ,
12431246 } ) ;
12441247
12451248 // The join rows link to the snapshot row above. With snapshot writes off there is no such row,
0 commit comments