fix: emit queue-updated events and expose verification status after deferred check#197
Merged
fix: emit queue-updated events and expose verification status after deferred check#197
Conversation
…eferred check When uploads complete with deferred article verification (DeferredCheckError), the UI had no feedback because: - `VerificationStatus` was missing from the backend `QueueItem` struct sent to the frontend, so pending/verified/failed states were invisible. - No `queue-updated` event was emitted on job completion (normal or deferred path), leaving the queue list stale until a user action triggered a refresh. - The `PostCheckRetryWorker` also emitted no event after resolving deferred articles, so `verified`/`verification_failed` transitions were silent. Fix: - Add `VerificationStatus` to `backend.QueueItem` and populate it in conversion. - Add `OnJobComplete` callback to `Processor`; call it on both completion paths in `processNextItem`; wire it to emit `queue-updated` in the backend. - Add `onStatusChanged` callback to `PostCheckRetryWorker`; call it after a successful `UpdateCompletedItemVerificationStatus`; wire it to emit `queue-updated` in the backend. - Add 5 targeted tests for the new callback behaviour in `postcheck_retry_worker_test.go`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VerificationStatusin frontend data:backend.QueueItemwas not including theverification_statusfield, so the frontend never knew whether a completed item waspending_verification,verified, orverification_failed.queue-updatedevent, leaving the queue list stale after an upload finished.PostCheckRetryWorker: When the background worker resolved deferred articles and updated the status toverifiedorverification_failed, the frontend received no notification.Changes
internal/backend/queue.goVerificationStatus *stringtoQueueItemstruct and populate in conversioninternal/processor/processor.goOnJobComplete func()callback; call on both normal and deferred completion pathsinternal/processor/postcheck_retry_worker.goonStatusChanged func()callback; call after successfulUpdateCompletedItemVerificationStatusinternal/backend/processor.goqueue-updated(Wails + web mode)internal/processor/postcheck_retry_worker_test.goonStatusChangedcallback behaviourTest plan
go test ./internal/processor/...— all 14TestProcessRetriessubtests passpending_verificationbadgePostCheckRetryWorkerresolves articles → item updates toverifiedorverification_failedwithout manual refresh🤖 Generated with Claude Code