Repository navigation
fix(requests): close open Requests screens when the server turns requests off - #748
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:
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Request API and capability status iosApp/iosApp/Networking/RequestsFeatureStore.swift, iosApp/iosApp/Networking/SiloAPI+Requests.swift, iosApp/Tests/RequestsScreensCloseTests.swift, docs/requests-api-v2.md |
The feature store accepts successful probe results only when they are current, and preserves cached values after failures. Selected API problems trigger a refresh. Tests cover probe ordering, reset behavior, and re-probe conditions; the capability description documents probe ordering. |
Route mirrors and navigation updates iosApp/iosApp/Navigation/RequestsRouteVisibility.swift, iosApp/iosApp/Navigation/AppRouter.swift, iosApp/iosApp/Screens/Collections/CollectionsView.swift |
The router tracks visible routes on all platforms and mirrors routes inside iOS detail cards. Session return points preserve route mirrors. Collection cards navigate through AppRouter. |
Closing unavailable Requests screens iosApp/iosApp/ContentView.swift, iosApp/iosApp/Navigation/AppRouter.swift, iosApp/Tests/RequestsScreensCloseTests.swift |
ContentView closes contiguous topmost Requests routes when the feature is known to be unavailable. Tests cover route visibility and closing behavior in main and detail-card navigation. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant SiloAPI
participant RequestsFeatureStore
participant ContentView
participant AppRouter
SiloAPI->>RequestsFeatureStore: refresh after a matching API problem
RequestsFeatureStore-->>ContentView: report known unavailable state
ContentView->>AppRouter: closeRequestsScreens()
Suggested reviewers: quick104
Merge Risk: 
Minimal · up to 11ee3
-
No merge-blocking Requests screen behavior is established; the change is mergeable after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · 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.
Comment @coderabbitai help to get the list of available commands.
2855ce4 to
e83d59b
Compare
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:
|
Quick104
left a comment
There was a problem hiding this comment.
Review of this PR's own commits (492be150, e83d59b7), on top of #747 and #746. One new finding is inline. I also added a common trigger to the existing route-mirror thread on AppRouter.swift. I'm fixing both in commits on this branch, so there's no need to change them yourself. A summary with the scores follows.
Review by Claude Code (claude-opus-5-5), with read-only review subagents.
This comment has been minimized.
This comment has been minimized.
Review summaryReviewed head: Since the last round
Remaining
Checks
VerdictFit: 9/10 · Readiness: 8/10 — conditional (assuming CI is green)
Review by Claude Code ( |
9f1f26f to
e45ae3b
Compare
This comment has been minimized.
This comment has been minimized.
* chore(deps): pin AetherEngine with upstream 7.36.0 Move the AetherEngine pin to 23889c5b, the fork main that merges upstream AetherEngine 7.29.0 through 7.36.0 plus upstream's live-playlist renewal (#748), Silo-Server/AetherEngine#21. Resolution moves LibTrueHD 2.0.0 to 2.3.0 and FFmpegBuild 3.6.0 to 3.7.1, and adds LibDTSX 1.0.1, the DTS:X decoder behind objectAudioRendering. Bundle LibDTSX's NOTICE and Apache license, list it in the acknowledgements, refresh the LibTrueHD NOTICE and the provenance notes, and refresh the reviewed build-input and selector snapshots for the new project.yml. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci: count LibDTSX in the release source proof's package graph The source proof requires the locked package graph to have an exact size. The AetherEngine pin adds LibDTSX, so the graph has 12 packages and the complete source graph 19 entries. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tvos): show Dolby Vision in playback stats when the TV switches to it An Apple TV set to SDR with Match Dynamic Range on switches the TV to the content's range, but Aether can't prove the panel left SDR (its EDR headroom stays 1.0), so it keeps reporting SDR. The stats showed "Dolby Vision Profile 7 → SDR" while the TV displayed Dolby Vision. When matching is on and the display supports the source's range, label that range, as Aether serves it to the panel either way. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tvos): label the stats range from the load's own matching decision A load made with HDR off in Silo's settings doesn't match the content's range, so the TV stays in SDR; the stats now follow that load's matchContentEnabled instead of the system setting alone. On a display without Dolby Vision, a Profile 5 or 7 source shows HDR10, the PQ base Aether routes there. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tvos): label a Dolby Vision base layer by its transfer On a matched display without Dolby Vision, Aether presents the Dolby Vision base layer: HLG for an HLG base, otherwise HDR10. Read the base's transfer from sourceVideoStreamFormat instead of inferring it from the profile number, so Profile 8.1 shows HDR10 and 8.4 shows HLG. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tvos): mark the stats range unconfirmed when the TV can't prove it tvOS reports one setting for frame-rate and range matching, so the app can't tell whether the TV switched to HDR. Instead of claiming the TV's mode, the stats name the range Aether sent and mark it unconfirmed, e.g. "Dolby Vision Profile 7 → Profile 8.1 (unconfirmed)". A Dolby Vision source with an SDR base layer (Profile 8.2) keeps the SDR label. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tvos): keep an SDR Dolby Vision base labelled SDR on any display Aether strips Dolby Vision from an SDR base layer (Profiles 8.2 and 10.2) and plays that base as SDR even on a Dolby Vision TV, so the stats check the base layer's transfer before naming Dolby Vision. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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:
|
|
Blocked accounts: fixed in 63581a1. A requests call refused with The typed |
63581a1 to
7818afc
Compare
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:
|
7818afc to
11ee3f8
Compare
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:
|
…ests off The Apple apps re-probe /api/v2/requests/status on every foreground, which hides the Requests entry points, but a Requests hub, My Requests, or request detail that was already open stayed on screen. Its search then showed a misleading "Nothing on TMDB matched" and every action failed with "Requests are turned off". 1.0 Requests AC7 says a server with requests off shows no request entry point anywhere, and Android now closes these screens. Once a probe answers that requests are unavailable, the run of Requests pages on top of the navigation stack closes back to whatever opened them, as on Android. On iPhone and iPad this includes the detail card: a card opened on a request detail closes, and a request page pushed inside a title card pops. A title opened from Requests stays; the Requests pages under it close when Back brings them into view. The same rule covers the Mac and Apple TV stacks; on Apple TV the Requests tab already disappears and the shell moves to Home, and a request detail pushed over it now pops as well. Nothing closes while the answer is unknown: the store now records whether a probe has answered for the current session, so the default "disabled" before the first answer, after a profile or server switch, or after a failed probe never closes a screen. The router now mirrors pushed routes on every platform (it already did on macOS for the sidebar) and inside the detail card, because NavigationPath cannot be inspected. A requests call refused with capability_disabled, capability_not_configured, or capability_unsupported triggers a re-probe, so a screen in use closes without waiting for the next foreground.
Every probe now takes a new generation, so an older probe that answers late cannot restore entry points after a newer probe found requests off. Follow support is published before isEnabled, so observers of the gate never read a stale value.
The library Collections grid pushed its pages with NavigationLink(value:), which skips the router's record of pushed routes. Closing Requests screens reads that record, so a leftover entry could line up with the collection page. After a user opened Requests, went back, and requests were turned off, every collection page popped as soon as it opened. The grid now navigates through the router, like the other collection grids. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every probe bumped the generation, so a newer probe that failed threw away an older probe's answer. Entry points could stay hidden, or open Requests screens stay open, until the next foreground. Probes are now numbered, and an answer counts unless a newer probe has already answered. Reset still discards probes from the previous session. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…on_denied An account blocked from requesting mid-session gets permission_denied from the requests endpoints, which did not re-probe the status, so open Requests screens stayed until the next foreground. The probe still decides: a refusal for another reason answers allowed and changes nothing.
11ee3f8 to
99d9814
Compare
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:
|
…ts off (#855) * fix(requests): re-check the requests capability when the app returns to the foreground Requests entry points must disappear when the server turns requests off (1.0 Requests AC7). Both shells probed /api/v2/requests/status only when the server or profile changed, so an admin who turned requests off while the app was in the background left the profile menu, search results, the TV Requests tab, and any open Requests screen in place until a restart or profile switch. The foreground access check that runs when the app returns from the background (phone and TV, process ON_START, skipped on the first start) now also re-probes the requests capability, as the Apple clients do on every foreground. The probe runs only after the shell's own probe for the current session has answered and only while signed in, and it keeps the store's generation guard against server and profile switches. On phone, an open Requests screen (hub, My Requests, request detail) now closes back to whatever opened it once a probe answers that requests are unavailable, matching how the TV shell leaves its Requests tab. A Requests screen restored before the first probe answers waits for that answer. (cherry picked from commit 779d7ce) * fix(requests): close request screens whenever the server turns requests off Builds on the foreground re-check from #560 so the Android apps match the Apple apps (Silo-Server/silo-apple#748): - A requests call the server refuses as requests-off (capability_disabled, capability_not_configured, capability_unsupported, permission_denied) reads the status again, so an app that stays in the foreground notices. - Screens close only on an answered "unavailable" (isKnownUnavailable), never on a failed status read, and an older answer can't overwrite a newer one. - Phone: the Discover row See all page closes with the other request screens. - TV: request detail closes too, and the Requests page and detail pop back to what opened them, like Back, instead of a state-saving pop to Home that left Requests in the opening tab's saved stack. - A failed token read in the foreground check no longer escapes its scope. Closes #854 * fix(requests): re-check on return to the foreground while the first probe is out The foreground check skipped until the shell's first status read had answered. If the app went to the background while that read was out, and it had read the status before requests were turned off, its stale "available" stood until the next refusal or foreground return. Skip only until the session's first probe has started. * fix(requests): keep the library and Requests foreground checks independent A failed library check no longer cancels the Requests status check that runs beside it on return to the foreground. Also correct the TV entry point in the README and FEATURES exposure notes: Requests opens from the profile menu, not a top-bar tab. * fix(requests): re-check on return to the foreground before the shell's first probe A phone restored onto a Requests screen after process death never shows the tab screen that starts the shell's status probe, so the foreground check skipped every return and the screen stayed open after requests were turned off. The foreground check already asks the server only while someone is signed in, and the store discards answers from before a server or profile switch, so it now probes without waiting for the shell. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Rhainland <[email protected]> Co-authored-by: Quick <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Problem
Related issue: Silo-Server/silo-server#1201
Validation tasks: unblocks #328 C3
Pairs with Silo-Server/silo-android#560
When an admin turns requests off, the Apple apps hide the Requests entry points on the next return to the foreground, but a Requests hub, My Requests or request detail that is already open stays on screen. Its search then shows "Nothing on TMDB matched that search" and its actions fail. This change closes open Requests screens once the server answers that requests are off.
Approach
RequestsFeatureStorenow records whether a probe has answered for the current session, so screens close only on an answered "unavailable", never while the answer is unknown, after a reset, or after a failed probe. The router keeps a list of pushed routes on every platform (it already did on macOS) and pops the Requests screens on top of the stack, so a title opened from Requests stays until Back reaches a Requests page. The library Collections grid now opens collections through the router as well, so that list stays in step with the stack. A requests call refused withcapability_disabled(or not configured or unsupported) re-probes the status. On Apple TV the existing tab handling already switches to Home when the Requests tab disappears; a request detail pushed over it now closes too.Validation
cec1e116,e45ae3b6): a newer probe that fails no longer discards an older probe's answer, with a unit test for it; iOS and macOS build on the fix head, and CI covers tvOS.permission_deniedre-probe (99d98144): the capability re-probe test covers it.mainatb90a86ea. feat(ios): lay out the app for the iPhone Duo's folded and open screens #889's detail-card swipe property and the new route record sit side by side inAppRouter.swift. fix(macos): keep the library row highlighted when opening a collection #854 had already moved the library Collections grid ontorouter.navigate(to:)for the Mac sidebar, so this PR's Collections commit now only extends its comment. The fix(tvos): main fails to build after On Deck focus change #753 tvOS build break is fixed onmain, so all three regression jobs run here.Evidence
Evidence: https://evidence.siloserver.org/r/silo-apple/pr-748/
Risks
The router now tracks pushed routes on iOS and tvOS too; the session-expiry return point saves and restores that list.
Checklist
AI Disclosure
gh), Playwright, Xcodexcodebuild/simctl, Maestro, Android emulator/adbclaude-opus-5-5)Note
Close open Requests screens when the server turns requests off
AppRouter.closeRequestsScreens, which pops only the topmost contiguous run of Requests routes, leaving non-Requests pages and containing detail cards in place.ContentViewtriggers it whenRequestsFeatureStore.shared.isKnownUnavailablebecomes true.RequestsFeatureStorewith probe ordinals so failed probes keep prior state, stale probes (pre-reset or older) are ignored, and reset returns the store to unknown.SiloAPInow rethrow errors but schedule a capability refresh when the problem iscapability_disabled,capability_not_configured,capability_unsupported, orpermission_denied.SessionReturnPointcaptures them for session restore.AppRouter.navigate(to:),presentItemDetail, andreplaceCurrentnow maintain route mirrors on iOS; the mirror must stay in sync with the opaque navigation paths orcloseRequestsScreensand session restore (resetToHome) may miss or miscount routes.Macroscope summarized 99d9814.