Skip to content

Destructive Actions

Destructive actions safety

Destructive actions are operations that mutate job state, queue state, or stored evidence. They need stronger safety rules than normal dashboard reads.

Destructive Commands

Examples:

  • cancel job;
  • restart job;
  • resurrect DLQ job;
  • repair and requeue DLQ job;
  • edit payload/tags/priority;
  • purge DLQ rows;
  • bulk cancel;
  • bulk restart;
  • bulk requeue by filter;
  • bulk purge by filter;
  • pause/resume queue;
  • change queue timeout;
  • change max workers.

Safety Layers

LayerPurpose
Hub input validationReject malformed IDs, queue names, payloads, tags, priorities, and filters.
Destructive authorization policyRequire stronger privilege for mutation.
Batch size capsPrevent huge accidental operations.
JSON validationPrevent edited payloads from becoming poison pills.
Filter normalizationKeep custom SignalR clients within supported bounds.
Typed confirmation in UIForce operator intent before high-impact actions.
Logs with actorPreserve audit evidence.

Bulk Operations

Bulk operations should always be treated as incident-grade actions. A safe flow is:

  1. Filter narrowly.
  2. Preview count and scope.
  3. Confirm typed token.
  4. Execute bounded batch.
  5. Refresh history page and stats.
  6. Watch failure rate and queue lag.

Architecture Decision

Why this pattern?

The Deck needs repair power during incidents, but repair power can destroy data or amplify failure. Safety must exist at both UI and hub boundaries.

Trade-offs

Extra confirmation slows expert operators. That is intentional for irreversible actions like purge.

Alternatives considered

AlternativeBenefitCost
UI-only validationGood UX.Custom clients can bypass it.
Hub-only validationStrong boundary.Worse UX without previews/confirmations.
No destructive actionsSafer surface.Operators fall back to dangerous ad hoc SQL.

Additional Questions

What is the riskiest action?
Bulk purge, because it permanently destroys recovery evidence.

Why validate JSON in the hub?
To prevent storing edited payloads that cannot be dispatched later.

Why log actor identity?
Operator actions are part of incident evidence and audit.

Apache 2.0 Licensed