Skip to content

fix(queue): clear in_progress row on retry to prevent duplicate UI entries#226

Merged
javi11 merged 1 commit into
mainfrom
claude/frosty-elgamal-5a548a
May 11, 2026
Merged

fix(queue): clear in_progress row on retry to prevent duplicate UI entries#226
javi11 merged 1 commit into
mainfrom
claude/frosty-elgamal-5a548a

Conversation

@javi11
Copy link
Copy Markdown
Owner

@javi11 javi11 commented May 11, 2026

Summary

  • Fix the bug where a failing upload appears as up to 3 duplicate entries in the queue UI before being marked as errored.
  • Add Queue.ClearInProgress(ctx, msgID) and call it from handleProcessingError before ReaddJob on both the retry path and the MarkAsError-fallback path.
  • Log errorType alongside the error message in handleProcessingError so the underlying upload failure (e.g. nntppool validation errors after the v4.11.1 bump) is easier to identify from user logs.
  • Add regression tests under internal/queue/queue_test.go covering the retry cycle and IsPathInQueue visibility, both green under -race.

Root cause

Each retry calls ReaddJob, which sends a new goqite message with a fresh ID. The previous in_progress_items row (keyed by the old message ID) was never deleted, so the same path showed up in multiple tables at once: the new pending goqite row plus 1–3 stale in_progress_items rows. The cap at 3 matched maxRetries = 3 in internal/processor/processor.go.

Test plan

  • go test -race ./internal/queue/ ./internal/processor/ passes
  • go vet ./internal/queue/ ./internal/processor/ clean
  • Manual: drop a file in a watch dir against an invalid NNTP server and confirm the UI shows a single entry transitioning pending → in_progress → pending → … → errored instead of multiple duplicate rows

…tries

Each retry called ReaddJob which generated a new goqite message ID, but the
in_progress_items row keyed by the previous ID was never deleted. The same
path then appeared in multiple tables simultaneously (pending goqite + 1-N
stale in_progress rows), surfacing in the UI as up to 3 duplicate entries
matching maxRetries=3.

Add Queue.ClearInProgress and call it before ReaddJob on both the retry
and MarkAsError-fallback paths. Also include errorType in the failure log
so the underlying upload error is easier to diagnose.
@javi11 javi11 merged commit a08be0f into main May 11, 2026
3 checks passed
@javi11 javi11 deleted the claude/frosty-elgamal-5a548a branch May 11, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant