mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-21 18:47:13 +02:00
fix(queue): close #1818 — Resume after failure clears the gate
Single failure on a printer with require_previous_success queue items
permanently skipped every downstream + every new item — the
_check_previous_success lookback always walked back to the original
failed row (skipped is excluded from the lookback), and no code path
could dismiss that failure.
Three pieces:
1. PrintQueueItem.gate_acknowledged Boolean column (default False).
SQLite/Postgres-safe ALTER, dialect-branched DEFAULT.
2. _check_previous_success skips rows where gate_acknowledged=True so
acknowledged failures walk past the lookback. Fresh post-resume
failures still gate independently.
3. POST /api/v1/queue/printer/{printer_id}/resume — gated on
QUEUE_UPDATE_ALL — acknowledges failed/aborted items for that
printer AND restores items where
status='skipped' AND error_message='Previous print failed or was
aborted' back to pending in one transaction. Returns
{acknowledged, restored}.
Frontend banner above the active Queue tab surfaces blocked printers,
fires a warning-variant ConfirmModal, and shows a precise toast on
success.
This commit is contained in:
@@ -4771,6 +4771,17 @@ export const api = {
|
||||
const qs = opts?.skipFilamentCheck ? '?skip_filament_check=true' : '';
|
||||
return request<PrintQueueItem>(`/queue/${id}/start${qs}`, { method: 'POST' });
|
||||
},
|
||||
/**
|
||||
* Clear the `require_previous_success` gate for a printer after the user
|
||||
* resolves the failure. Acknowledges any failed/aborted predecessors and
|
||||
* restores skipped items whose error_message matches the gate string
|
||||
* back to pending. Returns counts so the UI can render a precise toast.
|
||||
*/
|
||||
resumeQueueAfterFailure: (printerId: number) =>
|
||||
request<{ acknowledged: number; restored: number }>(
|
||||
`/queue/printer/${printerId}/resume`,
|
||||
{ method: 'POST' },
|
||||
),
|
||||
bulkUpdateQueue: (data: PrintQueueBulkUpdate) =>
|
||||
request<PrintQueueBulkUpdateResponse>('/queue/bulk', {
|
||||
method: 'PATCH',
|
||||
|
||||
Reference in New Issue
Block a user