Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions apps/worker/src/commands/__tests__/snapshot.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions apps/worker/src/commands/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,24 +159,6 @@ export async function snapshot({
error: message,
});

// Mark the environment snapshot as failed so the UI stops showing "Snapshotting..."
try {
await sdk.environments.updateSnapshotStatus({
environmentId,
snapshotStatus: 'failed',
});
} catch (envError) {
captureWorkerException(envError, {
runId,
environmentId,
stage: 'snapshot.updateSnapshotStatus',
});

console.error(
`Failed to update environment snapshot status: ${envError instanceof Error ? envError.message : String(envError)}`,
);
}

captureWorkerException(error, {
runId,
environmentId,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions packages/sdk/src/server/lib/task-runs/finish-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,14 @@ export const finishRun = async ({
);

// Anonymous analytics (no-op unless enabled): terminal task outcome with
// non-identifying routing facts only.
// non-identifying routing facts only. Snapshot maintenance is excluded from
// task_created, so exclude it here too to keep task reliability denominators
// aligned.
if (
status === RunStatus.Completed ||
status === RunStatus.Failed ||
status === RunStatus.Canceled
payloadKind !== TaskPayloadKind.SnapshotEnvironment &&
(status === RunStatus.Completed ||
status === RunStatus.Failed ||
status === RunStatus.Canceled)
) {
void captureTaskSettled(run.id, status, errorCode);
}
Expand Down
Loading