Summary
The arm.abandonJob(jobId) helper in src/ArmRipper.WebUi/wwwroot/js/jobRefresh.js (line ~115) is defined and exported on the arm namespace, but no view or script ever calls it. It may be dead code left over from an earlier iteration, or the Abandon button it was meant to back was never wired up.
What we know
- Helper:
arm.abandonJob(jobId) POSTs to /api/abandon/{id}, then reloads on success.
- Endpoint exists and is fully implemented:
ApiController.Abandon (POST /api/abandon/{id}, [ValidateAntiForgeryToken]) kills the job's PID, marks the job Failure, and ejects the disc (src/ArmRipper.WebUi/Controllers/ApiController.cs:143).
- Grep across all
.cshtml and .js in the repo finds zero callers of abandonJob — only its definition in jobRefresh.js.
- The active-rips table partial (
_ActiveJobRows.cshtml) and the pipeline partial (_Pipeline.cshtml) render no Abandon/Cancel button.
arm.abandonJob previously failed to send an antiforgery token, so even when called it would 400 against [ValidateAntiForgeryToken]. That token bug is now fixed (3d1146c renders a layout token + sends RequestVerificationToken), so the helper is callable again.
Questions to resolve
- Is
arm.abandonJob intended to back a UI button that was never added (missing functionality), or is it leftover dead code that should be removed?
- If the button is wanted: where should it live (Active Rips table rows, Job Detail actions row, both)? Should it require a confirm dialog? Does it need to distinguish "abandon" (kill + eject) from the existing cancel flows?
- If it is dead code: remove the helper and the now-unused
Abandon endpoint? (Or keep the endpoint for API clients.)
Suggested approach
- Decide intent (missing feature vs dead code) — likely requires product decision from maintainers.
- If missing feature: add an Abandon button consistent with the existing UI patterns and verify the full kill/eject flow.
- If dead code: remove
arm.abandonJob and consider deprecating/removing POST /api/abandon/{id}.
Related
Summary
The
arm.abandonJob(jobId)helper insrc/ArmRipper.WebUi/wwwroot/js/jobRefresh.js(line ~115) is defined and exported on thearmnamespace, but no view or script ever calls it. It may be dead code left over from an earlier iteration, or the Abandon button it was meant to back was never wired up.What we know
arm.abandonJob(jobId)POSTs to/api/abandon/{id}, then reloads on success.ApiController.Abandon(POST /api/abandon/{id},[ValidateAntiForgeryToken]) kills the job's PID, marks the jobFailure, and ejects the disc (src/ArmRipper.WebUi/Controllers/ApiController.cs:143)..cshtmland.jsin the repo finds zero callers ofabandonJob— only its definition injobRefresh.js._ActiveJobRows.cshtml) and the pipeline partial (_Pipeline.cshtml) render no Abandon/Cancel button.arm.abandonJobpreviously failed to send an antiforgery token, so even when called it would 400 against[ValidateAntiForgeryToken]. That token bug is now fixed (3d1146c renders a layout token + sendsRequestVerificationToken), so the helper is callable again.Questions to resolve
arm.abandonJobintended to back a UI button that was never added (missing functionality), or is it leftover dead code that should be removed?Abandonendpoint? (Or keep the endpoint for API clients.)Suggested approach
arm.abandonJoband consider deprecating/removingPOST /api/abandon/{id}.Related
arm.abandonJobfix for antiforgery: commit 3d1146c onfeat/main-feature-redirect(PR feat: mid-rip main-feature redirect with smarter track selection #72).