Skip to content

Modern Docker Management, Designed for Everyone

fix(jobs): let backend generate run IDs for manual job submissions (#3987)

Kyle Mendellaf96a6e99b3f
diff --git a/frontend/src/lib/components/job-card/job-card.svelte b/frontend/src/lib/components/job-card/job-card.svelte
index 19e2d1d99..4e243819f 100644
--- a/frontend/src/lib/components/job-card/job-card.svelte
+++ b/frontend/src/lib/components/job-card/job-card.svelte
@@ -36,15 +36,11 @@
collapsibleSettings?: boolean;
} = $props();
- let requestId: string | undefined;
let showScheduleDialog = $state(false);
const runJobMutation = createMutation(() => ({
- mutationFn: () => {
- requestId ??= crypto.randomUUID();
- return jobScheduleService.runJob(job.id, environmentId, requestId);
- },
+ mutationFn: () => jobScheduleService.runJob(job.id, environmentId),
+ retry: false,
onSuccess: () => {
- requestId = undefined;
toast.success(m.jobs_run_queued());
onScheduleUpdate?.();
}
diff --git a/frontend/src/lib/services/job-schedule-service.ts b/frontend/src/lib/services/job-schedule-service.ts
index 5aa3c8512..bbdf980f7 100644
--- a/frontend/src/lib/services/job-schedule-service.ts
+++ b/frontend/src/lib/services/job-schedule-service.ts
@@ -15,12 +15,8 @@ class JobScheduleService extends BaseAPIService {
return this.handleResponse(this.api.get(`/environments/${environmentId}/jobs`, config));
}
- async runJob(jobId: string, environmentId: string = '0', requestId: string = crypto.randomUUID()): Promise<JobRunResponse> {
- return this.handleResponse(
- this.api.post(`/environments/${environmentId}/jobs/${encodeURIComponent(jobId)}/run`, undefined, {
- headers: { 'Idempotency-Key': requestId }
- })
- );
+ async runJob(jobId: string, environmentId: string = '0'): Promise<JobRunResponse> {
+ return this.handleResponse(this.api.post(`/environments/${environmentId}/jobs/${encodeURIComponent(jobId)}/run`));
}
async listRuns(jobId: string, environmentId: string, page = 1): Promise<JobRunList> {
return this.handleResponse(