Repository navigation
ADFA-4894 feat(dashboard): download control surface — paused + pause/resume/retry - #453
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The engine half of the download control surface: a
pausedjob phase and pause/resume/retryverbs 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
pausedphase +pause(id)/resume(id)/retry(id), plus a sharedclassifyStop(ctx)so every runner treats pause vs cancel identically. Pause stops the runnerbut 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 erroredjob. resume/retry move the row to an ACTIVE phase before relaunch.
POST /:type/jobs/:id/{pause,resume,retry},409when the verb doesn't apply.npm run test:db(loads the native better-sqlite3 build), kept out of the defaultnpm test.Out of scope
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:db3/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.