Repository navigation
fix(database): read skip flags back in Repository queue lookups - #1055
Merged
Merged
Conversation
kipsilabs#994 made Repository.AddToQueue store skip_arr_notification and skip_post_import_links, but the Repository readers whose callers use the flags still do not select them: GetQueueItem, GetQueueItemByDownloadID, ListQueueItems and ListActiveQueueItems. A stored true reads back as false there. What that breaks: - Manual retry (POST /api/queue/{id}/retry) goes through Service.ProcessItemInBackground, which loads the item with GetQueueItem and hands it to the post-processor. The item is processed with both flags false, so the arrs are notified and import links are created anyway. - The SABnzbd queue skips items with SkipArrNotification, but reads them through ListActiveQueueItems, so they are shown to the arrs. - The SABnzbd history lookup by nzo_ids does the same check on items read with GetQueueItem / GetQueueItemByDownloadID. The full history already filters on the column in SQL. QueueRepository's own versions of these lookups already read the flags. Select and scan both columns in the four Repository readers. Other readers that leave them out (the nzb_path lookup in AddToQueue, which only uses the ID, and the stremio expiry lists) do not look at the flags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up to #964 / #994.
#994 made
Repository.AddToQueuestoreskip_arr_notificationandskip_post_import_links. TheRepositoryreaders whose callers use the flags still don't select them:GetQueueItem,GetQueueItemByDownloadID,ListQueueItemsandListActiveQueueItems. A storedtruereads back asfalsethere.QueueRepository's versions of these lookups already read the flags. Other readers that leave them out (thenzb_pathlookup insideAddToQueue, which only uses the ID, and the stremio expiry and failure lists) don't look at the flags.What that breaks:
POST /api/queue/{id}/retrygoes throughService.ProcessItemInBackground, which loads the item withRepository.GetQueueItemand hands it to the post-processor. An item queued withskip_arr_notification/skip_post_import_linksis then processed with both flags false: the arrs are notified and symlinks/STRM files are created anyway.handleSABnzbdQueueskips items withSkipArrNotification, but it reads them throughListActiveQueueItems, so they are shown to the arrs.nzo_ids: the same check, on items read withGetQueueItem/GetQueueItemByDownloadID. The full history already filters on the column in SQL.How to reproduce:
POST /api/import/filewithskip_arr_notification: true, then retry the item from the queue page. The arr gets notified.Changes
Select and scan both columns in the four
Repositoryreaders.Testing
TestRepositoryAddToQueue_PersistsSkipFlagsstores each flag combination throughAddToQueueand reads it back through the column and all four readers. It fails on main.go testpasses forinternal/database,internal/apiandinternal/importer. No frontend changes.The
GetQueueItem/GetQueueItemByDownloadIDpart has run in our fork since 2026-10-01. The two list readers are new in this PR.