Orphaned Sonarr/Radarr queue items not visible in Sofarr Active Downloads #73
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
There are a number of downloads that are active / completed / failed but still in the Sonarr (or Radarr) queue, which are not visible in the active downloads dashboard in Sofarr. This prevents users from seeing critical status alerts (such as stalled downloads, import warnings, and errors) and using the "Blocklist & Search" feature to re-search them.
Technical Analysis & Root Cause
The issue lies in how active downloads are constructed and matched in the backend:
server/routes/dashboard.js, active downloads are built viabuildUserDownloadsinsideserver/services/DownloadBuilder.js.sabnzbdQueue,sabnzbdHistory,qbittorrentTorrents) and *arr queues (sonarrQueue,radarrQueue).buildUserDownloadsonly aggregates download data by iterating over the active download client items:sabnzbdQueue.data.queue.slots) usingDownloadMatcher.matchSabSlotssabnzbdHistory.data.history.slots) usingDownloadMatcher.matchSabHistoryqbittorrentTorrents) usingDownloadMatcher.matchTorrentssonarrQueueorradarrQueuecache payload, but is NOT present in any of the download clients' active or completed item list (e.g., because the item finished and was removed/paused from the torrent/NZB client, it failed and was cleaned up, or it is in a download client instance not directly configured in Sofarr), it will never be matched and is completely omitted from the finaluserDownloadslist.Impact
Proposed Solution
To resolve this issue, the download builder should handle unmatched *arr queue items as standalone objects:
server/services/DownloadBuilder.js, track which Sonarr/Radarr queue record IDs (arrQueueId) were successfully matched during the download client passes.sonarrQueueRecordsandradarrQueueRecords.showAllormatchedUserTag).client:queueRecord.protocol(e.g.,usenet,torrent) or'sonarr'/'radarr'status: Map fromqueueRecord.statusorqueueRecord.trackedDownloadState(e.g.'Stalled','Import Pending','Downloading','Failed')progress: Map from100 - (queueRecord.sizeleft / queueRecord.size * 100)or standard *arr queue progress fieldsimportIssues: Extract viaDownloadAssembler.getImportIssues(queueRecord)arrQueueIdfor blocklist actions.userDownloadsarray returned to the dashboard SSE stream.Resolved in commit
50e1e09on develop.Added trace logger matching in titleMatches and a JSDoc example for buildArrDownload in commit
0364a3c.Resolved in develop branch in commits:
50e1e09(support orphaned *arr queue items and improve download matching reliability)0364a3c(JSDoc examples and log helper tracing)2f32edf(regression fix to restrict arrInstanceKey to admin users)Merged into main in release v1.7.35.