Skip to content

ADFA-4894 feat(dashboard): download control surface — paused + pause/resume/retry - #453

Merged
luisguzman-adfa merged 1 commit into
mainfrom
feat/ADFA-4894-control-surface
Aug 21, 2026
Merged

luisguzman-adfa merged 1 commit into
mainfrom
feat/ADFA-4894-control-surface

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

What

The engine half of the download control surface: a paused job phase and pause/resume/retry
verbs on the durable REST job engine, exposed over REST. Builds on the resilient runners shipped
in 1.2.3 (ADFA-4894 hardening). The app-facing buttons land separately under ADFA-4896.

Why

Part of the ADFA-4893 download contract: a heavy content download must be pausable and resumable
from its checkpoint, and an errored one retryable — without restarting from zero.

How

  • jobs.ts: a paused phase + pause(id) / resume(id) / retry(id), plus a shared
    classifyStop(ctx) so every runner treats pause vs cancel identically. Pause stops the runner
    but KEEPS the partial (the PAUSED-vs-CANCELLED distinction mirrors the APK ADFA-5119); resume
    re-launches (kiwix continues via aria2 --continue, books per item); retry re-runs an errored
    job. resume/retry move the row to an ACTIVE phase before relaunch.
  • kiwix.exec / books.exec: keep the partial on pause, clean only on cancel.
  • routes.ts: POST /:type/jobs/:id/{pause,resume,retry}, 409 when the verb doesn't apply.
  • jobs.test.ts: pause→paused, resume→done, retry-from-error, out-of-phase no-ops. Runs under
    npm run test:db (loads the native better-sqlite3 build), kept out of the default npm test.

Out of scope

  • App buttons that consume these verbs → ADFA-4896.
  • maps per-layer checkpoint (resume still restarts its layers) → ADFA-4898.

Verification

tsc --noEmit clean; default suite 79/79. Device (dev build): pause keeps the partial and resume
continues via --continue from a non-zero % (not a restart); the verbs return 409 out of phase; a
paused job survives a dash-node restart (not auto-resumed); test:db 3/3 in the box.

Note

Ships version 1.2.4 — this brings main off the lingering 1.2.3-dev.2 (the A merge kept its -dev
suffix) to a clean release, which the dashboard self-update / update-check surface.

…pause/resume/retry

The engine half of the download-control contract (ADFA-4893), on top of the resilient runners
already shipped in 1.2.3. The app-facing buttons land separately under ADFA-4896.

- jobs.ts: a 'paused' job phase + pause(id) / resume(id) / retry(id) on the durable engine, and a
  shared classifyStop(ctx) so every runner treats pause vs cancel the same way. Pause stops the
  runner but KEEPS the partial (the PAUSED-vs-CANCELLED distinction from the APK ADFA-5119); resume
  re-launches (kiwix continues via --continue, books per item); retry re-runs an errored job.
  resume/retry move the row to an ACTIVE phase before relaunch so completion/UI stay consistent.
- kiwix.exec / books.exec: on stop, keep the partial on pause and clean only on cancel.
- routes.ts: POST /:type/jobs/:id/{pause,resume,retry}, returning 409 when the verb doesn't apply.
- jobs.test.ts (npm run test:db — needs the native better-sqlite3 build): pause->paused,
  resume->done, retry-from-error, and the out-of-phase no-ops.

Version 1.2.4. tsc --noEmit clean; default suite 79/79. Device-verified: pause keeps the partial
and resume continues via --continue from a non-zero %, the verbs return 409 out of phase, a paused
job survives a dash-node restart, and test:db passes 3/3 in the box.
@luisguzman-adfa
luisguzman-adfa merged commit e9fa8b2 into main Aug 21, 2026
4 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/ADFA-4894-control-surface branch August 21, 2026 08:41
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.

1 participant