Skip to content

fix(libraries): leave hidden libraries out of navigation on phone and TV - #517

Merged
Quick104 merged 12 commits into
mainfrom
fix/issue-515-hide-hidden-libraries
Oct 8, 2026
Merged

Quick104 merged 12 commits into
mainfrom
fix/issue-515-hide-hidden-libraries

Conversation

@Quick104

@Quick104 Quick104 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A profile can hide libraries from navigation in the web app (Settings → Libraries → "Visible in navigation"). The choice is stored in the profile-scoped setting ui.disabled_library_ids. The phone and TV apps never read it. For a profile without a library limit, GET /api/v2/user/libraries still lists hidden libraries, so a hidden library stayed in the phone's library picker and the TV top bar. Opening it showed "Library not found", because the server's catalog reads already leave it out for that profile.

Closes #515

Solution

  • HiddenLibrariesStore (shared) reads ui.disabled_library_ids from the effective-settings endpoint. It parses the value the way the web's parseLibraryIDList does: an array, the legacy JSON-string form, or null, keeping only positive whole numbers. Each value is tied to the identity generation it was read under, so a profile or server switch never filters one profile's list with another's choice. Reads run one at a time, and a read waits out an identity change that is still in progress.
  • PersonalDataRepository.listUserLibraries and recheckUserLibraries leave hidden libraries out of every list they return and of the offline cache. The setting is read alongside the first list load for each profile. The re-check still compares the libraries on screen with the full server list, so a library the profile just hid counts as a removal, not as a short response.
  • ServerDrivenConfigRefresher (foreground and reconnect) re-reads the setting. Android has no user_settings.changed consumer, so this is the app's existing cross-device path. When the set changes, the store bumps a revision. The TV shell, the TV Audio and Libraries routes, and the phone Libraries screen re-load their lists when it changes. If that re-load fails, each one still drops the newly hidden libraries from the list it shows. If the open TV tab's library gets hidden, the TV returns to Home.
  • The app does not send include_hidden (fix(access): let Settings → Libraries show a restricted profile's hidden libraries silo-server#2058). ui.library_order and a screen for showing hidden libraries again are out of scope.

Validation

Validated on an isolated Silo dev deployment built from silo-server main (07dd4decd), using Android phone and Android TV emulators (API 36). The test account had no library limit and two libraries, Movies and TV Shows. I hid TV Shows through the settings call the web page makes. After that, the effective value read [2] and /user/libraries still listed both libraries.

  • Before, on main: the phone picker listed TV Shows and opening it showed "Library not found". The TV showed a Series tab that opened to "Library not found".
  • After, on this branch's head: the phone shows only Movies, with no library switcher. The TV top bar reads Home · Movies · For You · Calendar.
  • Changes from another device, without restarting the app: I backgrounded both apps, changed the setting through the API, and brought them back. Un-hiding brought back the TV's Series tab and the phone's switcher. Hiding again while the TV's Series tab was open sent the TV back to Home and removed the phone's switcher. The process IDs stayed the same throughout.
  • ./gradlew testDebugUnitTest across shared, android-shared, androidApp and androidTvApp: 0 failures. The new HiddenLibrariesStoreTest covers parsing, filtering and caching, the re-check, revision bumps, and reads that race a profile switch. MembershipActivationTest now binds SettingsApi in its Koin module, which the production PersonalDataRepository wiring needs.
  • Not exercised on a device: the TV Audio route's reload. The test deployment has no audiobook library, so the Audio tab can't appear. That route uses the same revision hook as the phone Libraries screen.
  • lintDebug (all three modules) and lintVitalRelease (both apps) report no new issues. I could not run scripts/check-build-supply-chain.sh and its self-test locally, because the host has no ruby. This diff does not touch build or dependency files.

Validation tasks: unavailable (the board lookup needs a read:project token scope I don't have).

Evidence: https://evidence.siloserver.org/r/silo-android/issue-515/

Risks

  • If the first settings read for a profile fails while the library list loads, nothing is hidden until a later read succeeds. Those lists, including the offline cache, can then hold the hidden library. The next successful read re-loads the screens.
  • The first list load for each profile now also makes one settings request, in parallel with the list request, and waits for it. On the test deployment both requests took 2–5 ms. A stalled settings endpoint would hold up that first list until its request times out.
  • A TV tab's saved library scope treats a missing library as deleted, so hiding the saved library falls back to another one, and un-hiding it doesn't bring the old selection back.

Follow-ups

  • Paired work: [bug] Hidden libraries still show in navigation silo-apple#691 (Apple apps, in progress separately).
  • Possible: keep the hidden set across launches, so an offline start or a failed first read still hides libraries.
  • User manual: unaffected. The site doesn't document per-profile library visibility, and this change makes the apps match what the web already does.

AI disclosure

  • Harness: Claude Code in T3 Code.
  • Model: claude-opus-5-5 investigated, implemented, tested and verified this change.
  • Review: Claude review subagents (claude-opus-5-5, plus claude-sonnet-5-5 for cleanup) reviewed the diff for correctness, callers, contract and failure handling, and conventions. They found out-of-order concurrent reads, a settings request on every list load, and dropped whole-number decimals; all three are fixed. Codex (gpt-6.1-sol, xhigh) ran an adversarial round on the result. It found that a read could straddle an identity change, that recovery after a failed read never re-loaded screens, and that a failed phone re-check could re-show a hidden library. All three are fixed and covered by tests. A suggestion to also refresh search and person-page filter chips while they stay open was declined as out of scope: those screens reload when reopened, and the server already leaves hidden libraries out of search. A second Codex round on the fixes found nothing. A final run of the Claude subagents found that the TV Audio and Libraries routes never re-loaded (fixed); its other notes are under Risks. On the PR, Kody found overlapping TV list loads, a failed TV re-load keeping a hidden library, and a list returned across a profile switch, and Codex found the same failed re-load gap in the TV shell; all are fixed, and a list request that crosses a switch now answers identity_changed.
  • Involvement: fully AI-generated, requested by a maintainer.

🤖 Generated with Claude Code

Note

Filter hidden libraries out of phone and TV library navigation

  • Adds HiddenLibrariesStore in HiddenLibrariesStore.kt. It loads the active profile's hidden library IDs from settings, parses both the canonical JSON array and the legacy JSON-string array, and exposes a revision flow when the hidden set changes.
  • PersonalDataRepository filters hidden libraries from server results, cached lists, and cache fallbacks. It also rejects results that straddle a profile or server switch.
  • Phone (LibrariesScreen) and TV (TvLibrariesScreen, TvMainShell) view models reload or update the visible list when the hidden-library revision changes. TV reloads recheck the server instead of falling back to stale cache and retry after a reachable-server probe.
  • ServerDrivenConfigRefresher refreshes the hidden-library store as part of server-driven config refreshes.
  • Behavioral Change: an in-flight library request that overlaps a profile switch now returns an identity-changed error instead of a success; see PersonalDataRepositoryCacheTest.kt.

Macroscope summarized 964c03a.

Quick104 and others added 3 commits October 7, 2026 21:10
The apps ignored the profile's ui.disabled_library_ids, so a library hidden
in the web app's Settings → Libraries still showed in phone and TV
navigation and opened to "Library not found".

The library list now leaves those libraries out. The setting is read with
the first list load for each profile and refreshed on foreground and
reconnect; a change there re-loads the TV tabs, the phone media modes and
the phone Libraries list.

Closes #515

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Wait out an identity change in progress before reading, so a read can't
carry the previous profile's hidden libraries under the new generation.
Announce a successful read that follows a failed one, since lists may
have gone out unfiltered, and filter the phone's retained list when a
re-check fails.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The TV Audio and Libraries routes load their library list once, so a
library hidden or shown on another device stayed until the screen was
recreated. Re-load it when the hidden-library revision changes, as the
phone Libraries screen does.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b4069b88-0232-4522-9a1f-15e258e75b36
📥 Commits

Reviewing files that changed from the base of the PR and between bfa6188 and 964c03a.

📒 Files selected for processing (13)
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/di/PlayerInfraModule.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/settings/ServerDrivenConfigRefresher.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/data/sync/MembershipActivationTest.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/libraries/LibrariesScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/di/AndroidTvModule.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/libraries/TvLibrariesScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/libraries/TvLibrariesViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/shell/TvMainShell.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/di/RepositoryModule.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/repository/HiddenLibrariesStore.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/repository/PersonalDataRepository.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/repository/HiddenLibrariesStoreTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/repository/PersonalDataRepositoryCacheTest.kt
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@silo-kody

silo-kody Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

// A switch advances the generation before it installs the new
// identity; wait it out so this read can't answer for the old one.
identityTransitions.withCurrentGeneration(generation) { } ?: return@withLock
val result = settingsRepository.getEffectiveValues(listOf(KEY))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules high

Identity-binding failure affects settingsRepository.getEffectiveValues(listOf(KEY)): the preceding withCurrentGeneration protects only an empty block, allowing an identity transition before the request resolves its identity, while the subsequent generation check can discard the response but cannot bind the request to the operation's captured identity. Capture a server/profile/authentication snapshot, pass it explicitly through a captured-scope repository API, and validate that scope's generation before storing the result.

Kody rule violation: Bind settings operations and serialization to their captured identity

Prompt for LLM

File shared/src/commonMain/kotlin/org/siloserver/silo/repository/HiddenLibrariesStore.kt:

Line 70:

Identity-binding failure affects settingsRepository.getEffectiveValues(listOf(KEY)): the preceding withCurrentGeneration protects only an empty block, allowing an identity transition before the request resolves its identity, while the subsequent generation check can discard the response but cannot bind the request to the operation's captured identity. Capture a server/profile/authentication snapshot, pass it explicitly through a captured-scope repository API, and validate that scope's generation before storing the result.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing this. IdentityTransitionBarrier.changing() sets the new generation before it runs the block that installs the new identity (IdentityTransitionBarrier.kt:117-120), so a request can never see the new identity while the generation is still the captured one. Any request that overlaps a switch, under either identity, ends with generation != identityTransitions.generation.value and is dropped (HiddenLibrariesStore.kt:71) before anything is stored. The withCurrentGeneration fence covers the remaining case, a read that starts mid-switch, by waiting until the new identity is installed. aReadStartedMidSwitchAnswersForTheNewIdentity fails without the fence. Pinning an explicit snapshot would add no protection the generation check doesn't already give.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed—given the barrier ordering you describe, my original suggestion does not establish a correctness bug in this read path.

The two protections cover different cases:

  • A read starts during a transition: withCurrentGeneration waits for identity installation to finish, or rejects the captured generation if it is no longer current.
  • A transition starts after that fence: the generation advances before the identity changes, so the subsequent generation check rejects the response before it is stored, regardless of which identity the request used.

The empty block is therefore a synchronization fence, not an attempt to bind the request’s identity. I mischaracterized its purpose.

An explicit identity snapshot would bind the request itself, but that is stronger than necessary to prevent stale results from entering this read-only store under the ordering you described. I would not require that change here or retain the high-severity finding on this basis.

@Quick104
Quick104 marked this pull request as ready for review October 8, 2026 01:46
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T02:28:40.916139Z 55095f9 New commits
🔒 Security Review ✅ Completed 2026-10-08T02:27:17.622592Z 55095f9 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 43a0e561bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Return identity_changed when the profile changes while a library list
waits for the hidden-library read, instead of the old profile's list.
On TV, a new Audio or Libraries load replaces one still running, and a
hidden-library change drops newly hidden libraries before the re-load, so
a failed re-load can't keep them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc62cd4067

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A hidden-library change re-loads the TV shell's library list once. When
that re-load failed, the shell kept the newly hidden library and nothing
retried. Filter the list it keeps instead.

Also drop the phone MainScreen re-load on a hidden-library change: its
media modes feed only visibleMobileTabs, which ignores them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 1 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Validate download ownership before publishing subtitle bytes

Kotlin runs property initializers and init blocks in source order, so
the TV view model's loadJob initializer ran after init { load() } and
dropped the first load's job, which a hidden-library re-load then
couldn't cancel. Declare the revision and load-tracking properties above
init in both library view models.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b534f42ded

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…again

A hidden-library change re-loads the TV shell's list once. If that load
failed after a library was shown again on another device, the tab stayed
missing until the shell was recreated. Mark the load pending on failure
and retry it when reachability returns to reachable.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 1 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Validate download ownership before publishing subtitle bytes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 34037dd81c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +314 to +315
val result = if (fetched.canServeCache() && known.isNotEmpty()) {
ApiResult.Success(personalDataRepository.withoutHidden(known))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retry the phone reload after an unhide failure

When another device unhides a library and this recheck returns a network error or 5xx, known contains only the previously visible libraries, so this fallback cannot restore the newly unhidden one. The revision has already been consumed by onHiddenLibrariesRevision, and a reconnect refresh that reads the same hidden-ID set does not emit another revision; unlike the TV shell, the phone has no reconnect-triggered retry, so the library remains absent until another lifecycle resume or manual refresh. Keep this reload pending and retry it after connectivity returns.

AGENTS.md reference: AGENTS.md:L9-L10

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not adding a reconnect retry on the phone. LibrariesScreen already re-checks the list on every ON_RESUME: entering the Libraries tab and coming back to the app (#487). That's its existing recovery path for a failed load, and a library un-hidden during an outage comes back on the next one. The TV shell needed a reachability retry because it has no such hook; the phone does. This case also errs toward showing less, never toward an unopenable library. Leaving this open for a maintainer.

If the server was already reachable when the failed load returned, the
status key never changed again and the retry never ran. Key it on the
probe time too, so the next reachable probe retries.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 1 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Validate download ownership before publishing subtitle bytes

The pending flag stayed set while a retry ran, so the next reachable
probe bumped the retry key and cancelled it; a slow load could be
restarted indefinitely. Clear the flag when a load starts, so it means
the last load failed and none is running.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 1 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Validate download ownership before publishing subtitle bytes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c13c7e5148

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…e probe

When a library was shown again on another device and the route's
re-load failed, nothing retried it: the hidden-library revision had been
consumed, and the shell's reachability retry only covers the shell's own
list. Keep the load pending on failure and retry it on the next reachable
probe, as the shell does.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2204e7cd3b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

listUserLibraries falls back to the offline cache on a network failure,
so a hidden-library re-load during an outage looked like a success with
a stale list, and nothing retried it. After the first load, the TV shell
and the Audio/Libraries view model now re-check, which reports the
failure, keeps what's shown and leaves the load pending for the next
reachable probe.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 55095f9fa2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// re-checks, so a failure stays a failure and stays pending, rather
// than a cached list that misses a library shown again since.
val result = if (librariesLoaded) {
personalDataRepository.recheckUserLibraries(value.mapTo(mutableSetOf()) { it.id })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retry successful short reloads after an unhide

When a library is unhidden remotely and the first successful /user/libraries response is transiently short and omits that library, value contains only the previously visible libraries, so this known-ID check accepts the short response without a second read. Unlike the earlier error-path case, this returns ApiResult.Success, so librariesReloadPending remains false and reachable probes do not retry; the restored media-type tab stays absent until the shell is recreated. Preserve the full previously known server IDs or otherwise retry additions after an unhide.

AGENTS.md reference: AGENTS.md:L11-L11

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing this. It needs the server to return a short list right after an un-hide, one that leaves out the newly visible library. The client can't tell that apart from the library not being there, and keeping "previously known server ids" would mean keeping hidden ids in the shell's list, which is the state this PR removes. The short-response recovery from #487 confirms a shrink of libraries already shown; it can't detect a missing addition. A server returning short lists is a separate bug that would need its own fix. Leaving this open for a maintainer.

The cache write suspends after the last identity check, so a profile
switch during it could still hand the old profile's list to the caller.
Check the generation again after the write and answer identity_changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104
Quick104 merged commit cad4d0b into main Oct 8, 2026
9 checks passed
@Quick104
Quick104 deleted the fix/issue-515-hide-hidden-libraries branch October 8, 2026 03:01
Quick104 added a commit to Rhainland/silo-android that referenced this pull request Oct 10, 2026
Conflicts with main's library-list re-check (Silo-Server#487), hidden libraries
(Silo-Server#517), household management (Silo-Server#493), and TV library browse (Silo-Server#468, Silo-Server#532)
were resolved by keeping both sides:

- LibrariesViewModel uses main's queued re-check loop, which already keeps
  an older library list from landing after a newer refresh, so the PR's
  separate job cancel is dropped. refreshAfterAccessChange() still clears
  the loaded subtabs and facets first.
- The profile pickers keep both the stale-profile reload and main's
  manage-mode exit.
- TvMainShell keys the library load on the hidden-libraries revision, the
  retry counter, and the access key.
- libraryListChangedSinceCached() now goes through recheckUserLibraries().
  Main caches only the visible libraries and confirms a short list before
  trusting it; comparing that cache with the raw server list would report
  an access change on every foreground return for a profile that hides a
  library, and would write hidden libraries back into the cache.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

[bug] Hidden libraries still show in navigation

1 participant