Repository navigation
fix(ci): fix catalog return values and flaky jellycompat stop test - #2025
Conversation
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (2)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
Related issue: N/A
Validation tasks: none
CI on this branch fails for two reasons. A return statement in the catalog collection loader has the wrong number of values, and a Jellyfin-compat playback test that checks a position-less Stopped report passes or fails depending on the order in which goroutines acquire a lock. This change fixes both.
Approach
In
loadCollectionSource, the branch for a collection that falls outside the requested library scope returned two values where the function returns three. It now returns the collection title with no items and no error, as the other branches do.TestHandlePlaybackPositionlessStoppedUsesQueuedReportPositionrelied on waiters acquiring the scrobble lock in a particular order, which Go mutexes don't guarantee. The test now holds the lock the way an in-flight report does, waits until the Stopped request queues behind it, applies the report position, and then releases the lock. The test asserts the same behavior as before: a position-less Stopped report uses the position of the report queued ahead of it. The expected scrobbles are now a start at 0 and a stop at 551, because the test no longer sends the intermediate report through the scrobbler.Validation
internal/catalogandinternal/jellycompat: not run when this description was drafted. Add the results before opening the PR.make lint-changedand the rest of the CONTRIBUTING.md gate: not run when this description was drafted.Evidence
Evidence: none, no user-visible change
Risks
None identified. The production change is one return statement, and the rest is a test.
Checklist
AI Disclosure
Note
Fix
CatalogResolver.loadCollectionSourcereturn value and deflake jellycompat stop testCatalogResolver.loadCollectionSourcenow returns the collection title as the resolved source name when a library collection cannot be scoped, instead of an empty string. It still returns no media items and no error.TestHandlePlaybackPositionlessStoppedUsesQueuedReportPositionin playback_scrobble_test.go to start the stream directly and hold the compatibility scrobble lock, instead of async upstream playback. The test now verifies the positionless Stopped report uses the updated playback-manager position and scrobbles start and stop at positions 0 and 551.Macroscope summarized b484f66.