feat(health): persist download_id in file_health table and backfill from history#766
Open
drondeseries wants to merge 4 commits into
Open
feat(health): persist download_id in file_health table and backfill from history#766drondeseries wants to merge 4 commits into
drondeseries wants to merge 4 commits into
Conversation
812ff11 to
e4c5b0e
Compare
drondeseries
added a commit
to drondeseries/altmount
that referenced
this pull request
Jul 6, 2026
- fix(health): masking must be explicit opt-in (Enabled != nil && Threshold > 0); the old nil-or-true condition silently enabled masking by default and a zero threshold immediately masked every file, suppressing all repairs - fix(migration): use exact equality (=) instead of LIKE prefix in migration 034 backfill; underscore in path names is a LIKE wildcard that could assign the wrong download_id from an unrelated release - fix(quota): guard quota auto-reset on QuotaUsed == 0 to skip idle providers; without this every configured-but-unused provider triggered a spurious DB write and log line on every tick after its reset time expired - fix(health): handle sql.ErrNoRows explicitly in IncrementStreamingFailureCount; first occurrence (file not yet in file_health) is not a DB error — proceed with repair rather than logging a misleading warning - fix(health): add download_id to GetUnhealthyFiles SELECT and Scan so the health worker receives the persisted download_id instead of always falling back to a secondary import_history lookup (defeating the purpose of PR javi11#766) - docs(rar): add clarifying comment to seenNames duplicate detection explaining why early break is correct for obfuscated multi-volume archive detection
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
This PR decouples the library health and automated ARR repair systems from the transient
import_historytable.Detailed Changes
download_idcolumn to thefile_healthtable to store Sonarr/Radarr tracking IDs. This allows users to prune/delete theirimport_history(e.g., viaHistoryRetentionDays) without breaking automated ARR repairs or Mount-to-Safety-Folder sync checks.034(SQLite & PostgreSQL) with backfill queries to map existing files infile_healthto their original download IDs from theimport_historytable before it is cleared.arrs_handlers.go) and post-import health registration scheduler (health_scheduler.go) to capture and persist thedownload_idon creation.