Skip to content

Commit 46ad351

Browse files
committed
Use completedAt instead of updatedAt
1 parent 79d6044 commit 46ad351

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

apps/webapp/app/components/run/RunTimeline.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function buildTimelineItems(run: TimelineSpanRun): TimelineItem[] {
248248
items.push({
249249
type: "line",
250250
id: "executing",
251-
title: formatDuration(run.executedAt, run.updatedAt),
251+
title: formatDuration(run.executedAt, run.completedAt ?? run.updatedAt),
252252
state,
253253
shouldRender: true,
254254
variant: "normal",
@@ -271,7 +271,7 @@ function buildTimelineItems(run: TimelineSpanRun): TimelineItem[] {
271271
items.push({
272272
type: "line",
273273
id: "legacy-executing",
274-
title: formatDuration(run.startedAt, run.updatedAt),
274+
title: formatDuration(run.startedAt, run.completedAt ?? run.updatedAt),
275275
state,
276276
shouldRender: true,
277277
variant: "normal",
@@ -296,7 +296,7 @@ function buildTimelineItems(run: TimelineSpanRun): TimelineItem[] {
296296
type: "event",
297297
id: "finished",
298298
title: "Finished",
299-
date: run.updatedAt,
299+
date: run.completedAt ?? run.updatedAt,
300300
previousDate: run.executedAt ?? run.startedAt ?? undefined,
301301
state,
302302
shouldRender: true,

apps/webapp/app/presenters/v3/RunListPresenter.server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ export class RunListPresenter extends BasePresenter {
209209
lockedAt: Date | null;
210210
delayUntil: Date | null;
211211
updatedAt: Date;
212+
completedAt: Date | null;
212213
isTest: boolean;
213214
spanId: string;
214215
idempotencyKey: string | null;
@@ -238,6 +239,7 @@ export class RunListPresenter extends BasePresenter {
238239
tr."delayUntil" AS "delayUntil",
239240
tr."lockedAt" AS "lockedAt",
240241
tr."updatedAt" AS "updatedAt",
242+
tr."completedAt" AS "completedAt",
241243
tr."isTest" AS "isTest",
242244
tr."spanId" AS "spanId",
243245
tr."idempotencyKey" AS "idempotencyKey",
@@ -383,7 +385,9 @@ WHERE
383385
startedAt: startedAt ? startedAt.toISOString() : undefined,
384386
delayUntil: run.delayUntil ? run.delayUntil.toISOString() : undefined,
385387
hasFinished,
386-
finishedAt: hasFinished ? run.updatedAt.toISOString() : undefined,
388+
finishedAt: hasFinished
389+
? run.completedAt?.toISOString() ?? run.updatedAt.toISOString()
390+
: undefined,
387391
isTest: run.isTest,
388392
status: run.status,
389393
version: run.version,

0 commit comments

Comments
 (0)