Skip to content

Investigate Abandon button: dead code or missing UI? #75

Description

@negativeeddy

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

  1. 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?
  2. 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?
  3. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions