Repository navigation
fix(catalog): reject disabled dual-library items - #43
Merged
Merged
Conversation
2 tasks done
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.
Problem
Related issue: N/A — narrow fix
Disabled-library filtering was evaluated against one joined membership row. An item linked to both an enabled library and a disabled library could therefore pass through its enabled row. The same membership join could also duplicate POST catalog rows and inflate
COUNT(*) OVER()totals.The current fork and upstream implementations of the affected starting paths were byte-identical before this change.
Approach
EXISTS/NOT EXISTSpredicates.FetchEpisodesByContentIDsgap.episode_librariesmembership on the optimized episode-entry scan before applying its global deny.Validation
Red against
13d2dcd72fb8b7c4e109766c533e4b2c19c9c9adbefore the production change:Passing after the fix:
The database-backed
TestDualLibraryItemDeniedByDisabledLibraryDBwas discovered and compiled but skipped locally becauseSILO_TEST_DATABASE_URLis unset. The complete localinternal/jellycompatpackage run reached two pre-existing macOS process-identity failures (TestBeginWebOperationRecoversDeadProcessLockandTestBeginWebOperationRejectsLiveProcessLock); all changed Jellycompat tests pass. GitHub Actions remains the full-matrix authority.GitHub Actions on
4670728deaf7b8199a764d9aee0fe4029b35e3c1passed the complete Go, Web, and docs-hygiene jobs. An earlier run stopped at changed-lines lint because the newrecently_addedcomparison crossed thegoconstthreshold;6b5e55b0extracted the package constant, and the replacement run passed lint and full Go tests.No UI files changed, so screenshots are not applicable.
Risks
No migration or production configuration change. The policy change is deliberately fail-closed for dual-membership items: any membership in a disabled library hides the item, even when another requested or allowed membership exists. The correlated membership probes use existing membership primary/index keys; the reviewed paths either remove join fanout or retain their indexed single-library fast path.
AI Disclosure
Checklist