Skip to content

fix(database): read skip flags back in Repository queue lookups - #1055

Merged
javi11 merged 1 commit into
kipsilabs:mainfrom
firestaerter3:fix/skip-flags-read-back
Nov 11, 2026
Merged

javi11 merged 1 commit into
kipsilabs:mainfrom
firestaerter3:fix/skip-flags-read-back

Conversation

@firestaerter3

Copy link
Copy Markdown
Contributor

Follow-up to #964 / #994.

#994 made Repository.AddToQueue store skip_arr_notification and skip_post_import_links. The Repository readers whose callers use the flags still don't select them: GetQueueItem, GetQueueItemByDownloadID, ListQueueItems and ListActiveQueueItems. A stored true reads back as false there. QueueRepository's versions of these lookups already read the flags. Other readers that leave them out (the nzb_path lookup inside AddToQueue, which only uses the ID, and the stremio expiry and failure lists) don't look at the flags.

What that breaks:

  • Manual retry: POST /api/queue/{id}/retry goes through Service.ProcessItemInBackground, which loads the item with Repository.GetQueueItem and hands it to the post-processor. An item queued with skip_arr_notification / skip_post_import_links is then processed with both flags false: the arrs are notified and symlinks/STRM files are created anyway.
  • SABnzbd queue: handleSABnzbdQueue skips items with SkipArrNotification, but it reads them through ListActiveQueueItems, so they are shown to the arrs.
  • SABnzbd history by nzo_ids: the same check, on items read with GetQueueItem / GetQueueItemByDownloadID. The full history already filters on the column in SQL.

How to reproduce: POST /api/import/file with skip_arr_notification: true, then retry the item from the queue page. The arr gets notified.

Changes

Select and scan both columns in the four Repository readers.

Testing

  • TestRepositoryAddToQueue_PersistsSkipFlags stores each flag combination through AddToQueue and reads it back through the column and all four readers. It fails on main.
  • go test passes for internal/database, internal/api and internal/importer. No frontend changes.

The GetQueueItem / GetQueueItemByDownloadID part has run in our fork since 2026-10-01. The two list readers are new in this PR.

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>
@javi11
javi11 merged commit e096218 into kipsilabs:main Nov 11, 2026
2 checks passed
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.

2 participants