Skip to content

feat: pause and resume job schedules from the job page - #1243

Merged
crypt0rr merged 1 commit into
mainfrom
feat/job-pause-resume
Oct 7, 2026
Merged

crypt0rr merged 1 commit into
mainfrom
feat/job-pause-resume

Conversation

@crypt0rr

@crypt0rr crypt0rr commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Summary

Pause and resume from the job page (#1232)

  • The job page header has a Pause schedule / Resume schedule button. It calls the existing POST /jobs/{id}/pause and POST /jobs/{id}/resume endpoints with the loaded revision. Until now these were wrapped in api.ts but nothing in the console called them, so the only way to pause was Edit → "Schedule enabled" → Save, which also resubmits the whole form.
  • The button is disabled while the job's scan runs, because the server answers 409 job_active, and hidden for archived jobs. Errors such as job_active or a revision conflict appear in the page's alert, and a conflict reloads the job.

Targeted live-update invalidation

  • These server events used to fall through to the stream handler's default branch, which called invalidateQueries() with no arguments in every open tab of the unit:
    • job.paused, job.resumed
    • baseline-approved, baseline-reset, baseline-complete, baseline-updated, baseline-stalled
    • job-silent
    • scan.cancellation_requested, scan.cycle_discarded
    • scanner-profile.changed
  • Each now invalidates only the queries it affects. The default full refresh stays as the safety net for unknown events.

Docs: the jobs guide describes pausing and resuming.

Compatibility

Console only; there are no API changes.

Validation

  • npm run lint
  • Vitest: 45 files, 460 tests passed.
  • npm --prefix docs run build

New tests:

  • JobDetail.actions.test.tsx:
    • pause, then resume, each with the loaded revision;
    • an operator sees the 409 job_active message;
    • the button is disabled while a scan runs and absent for archived jobs.
  • main.test.tsx: each listed event triggers its targeted invalidation and no full refresh.

Fixes #1232

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying edgewatch with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4194543
Status: ✅  Deploy successful!
Preview URL: https://9b1ebcc8.edgewatch-cpd.pages.dev
Branch Preview URL: https://feat-job-pause-resume.edgewatch-cpd.pages.dev

View logs

The job page has a Pause schedule / Resume schedule button that uses the
existing pause and resume endpoints with the loaded revision, instead of
requiring an edit and save of the whole job. It is disabled while the
job's scan runs and hidden for archived jobs.

The console now handles job.paused, job.resumed, the baseline events,
job-silent, scan.cancellation_requested, scan.cycle_discarded and
scanner-profile.changed with targeted query invalidation instead of
refreshing every cached query in every open tab.

Fixes #1232
@crypt0rr
crypt0rr force-pushed the feat/job-pause-resume branch from 0aaeb91 to 4194543 Compare October 7, 2026 16:33
@crypt0rr
crypt0rr merged commit 2e26729 into main Oct 7, 2026
15 checks passed
@crypt0rr
crypt0rr deleted the feat/job-pause-resume branch October 7, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P3] No pause/resume control outside the job editor; unhandled live-update events refresh every query

1 participant