Repository navigation
Conversation
The 1.0 Requests acceptance criteria keep request administration (approve, decline, retry, limits, auto-approve) in web admin, and the native validation tasks say not to expose it on native clients. The Android apps still offered it: an Approvals screen and summary cards on phone, approval and failed-request rows on TV, and Approve, Decline, and Retry on the request detail pages of both. This removes that surface and the code behind it: the admin request endpoints in RequestsApi and their models, the admin capability probe and canModerate in RequestsFeatureStore, RequestApprovalsViewModel, the moderation state in RequestDetailViewModel and RequestDetailCache, and the requests/approvals route. Users keep requesting titles, cancelling their own pending requests, and following request status. Without the moderation lookup, the detail page's own create or cancel broadcast could reach its listener after the action finished and trigger a second read; the page now ignores the broadcast of its own action. A source guard test fails if Android code calls the admin request endpoints or brings the moderation surface back. AGENTS.md, FEATURES.md, and README.md now say request administration stays in web admin.
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:
|
|
Warning Review limit reachedYou'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 1 minute. View limit details
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 |
c7f1db3 to
cf5e637
Compare
Removing the requests/approvals destination left no destination for a back stack saved by an older build, and Navigation throws when it restores an entry whose destination is missing. Register a hidden redirect to Requests, like the existing admin and card overlays aliases, so such a restore lands on Requests. It renders nothing and offers no moderation. The source guard allows only the alias's two lines in AppNavigation.kt.
…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.
cf5e637 to
779d7ce
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]>
|
This PR is superseded: #855 (98d0771) cherry-picked its commit onto main with authorship kept, and built the remaining Requests-off handling on top. The PR it was stacked on, #558, merged as c73770f. Main already has everything this branch changes: This PR closes no issues. Silo-Server/silo-server#1201 is only linked as related and stays open as the v1 Requests tracker. Thank you for the work, @Rhainland. |
Problem
Related issue: Silo-Server/silo-server#1201
Validation tasks: unblocks #338 C3, #339 C3
The Android apps check whether the server has Requests on only at startup and on a server or profile switch. When an admin turns requests off while the app is in the background, the profile-menu entry, the search "Available to request" section and any open Requests screen stay until the app restarts, and search shows "The requests capability is disabled by an administrator." This change re-checks when the app returns to the foreground, and the phone app closes open Requests screens once the server answers that they are off.
Approach
The existing foreground hook (
ForegroundAccessCheck) now also re-checks Requests, once the shell's own first check has answered and while signed in. On phone, Requests screens on top of the back stack pop back to whatever opened them on an answered "unavailable", never while the answer is unknown. Android TV already left its Requests tab when it disappears. This mirrors Apple, which re-checks on every foreground.Stacked on #558 (merge that first).
Validation
:shared,:androidAppand:androidTvAppunit tests: pass, exceptReflowStyleTest("line height flows from settings"), which fails the same way onmain.Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/pr-560/
Risks
One extra status request each time the app returns to the foreground.
Checklist
AI Disclosure
gh), Playwright, Xcodexcodebuild/simctl, Maestro, Android emulator/adbclaude-opus-5-5)