Repository navigation
feat(requests): let users remove their own failed requests - #792
Conversation
A failed request stayed in the requests list with no way to clear it.
Phone My Requests and the TV Requests page now offer Remove on a failed
request that delivered nothing, after a confirmation that names the
title. A request that delivered one quality before failing keeps no
Remove action. The action appears only when the server reports
remove_failed_supported, so older servers see no change.
Removing calls DELETE /api/v2/requests/{id}, drops the row, makes the
title requestable again on every surface, and confirms with "Request
removed". A 409 conflict (retried or completed since the list loaded)
re-reads the list and says why nothing was removed. On TV, focus moves
to the neighbouring card when the focused one leaves the page.
Server dependency: Silo-Server/silo-server#3430.
Closes Silo-Server#791
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 reachedThis review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Next included review available in 43 minutes. View limit details
|
| Layer / File(s) | Summary |
|---|---|
Removal capability and API contract shared/src/commonMain/kotlin/org/siloserver/silo/model/feature/RequestsFeatureStore.kt, shared/src/commonMain/kotlin/org/siloserver/silo/model/request/*, shared/src/commonMain/kotlin/org/siloserver/silo/network/api/RequestsApi.kt, shared/src/commonTest/kotlin/org/siloserver/silo/model/*, shared/src/commonTest/kotlin/org/siloserver/silo/network/apiv2/* |
The models define which failed requests are removable and expose the server capability. The API adds removeFailed; tests cover capability tracking, eligibility, and API responses. |
Repository removal and event propagation shared/src/commonMain/kotlin/org/siloserver/silo/repository/*, shared/src/commonMain/kotlin/org/siloserver/silo/viewmodel/RequestDiscoverRowViewModel.kt, shared/src/commonMain/kotlin/org/siloserver/silo/viewmodel/RequestsViewModels.kt |
The repository removes successful records from its list and cache and emits removal events. Request, search, and discovery results apply those events. |
Removal state and outcome handling shared/src/commonMain/kotlin/org/siloserver/silo/viewmodel/RequestsViewModels.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/di/AndroidModule.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/di/AndroidTvModule.kt, shared/src/commonTest/kotlin/org/siloserver/silo/viewmodel/RequestsViewModelTest.kt |
The view model tracks removal capability, progress, and notices. It handles removal outcomes and updates request lists. Dependency injection and tests cover the new view-model behavior. |
Phone and TV removal interfaces androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/requests/*, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/requests/TvRequestsPage.kt, androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/requests/* |
The screens show eligible removal actions and confirmation dialogs. They display notices and busy state; the TV page also selects a successor card when the focused card disappears. Tests cover TV action availability. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Severity of issue fixed: Medium
Sequence Diagram(s)
sequenceDiagram
actor User
participant MyRequestsScreen
participant MyRequestsViewModel
participant RequestsRepository
participant RequestsApi
participant RequestsServer
User->>MyRequestsScreen: Confirm removal
MyRequestsScreen->>MyRequestsViewModel: removeFailed(record)
MyRequestsViewModel->>RequestsRepository: removeFailed(record)
RequestsRepository->>RequestsApi: removeFailed(id)
RequestsApi->>RequestsServer: DELETE /api/v2/requests/{id}
RequestsServer-->>RequestsApi: Removal response
RequestsApi-->>RequestsRepository: ApiResult
RequestsRepository-->>MyRequestsViewModel: Removal event
MyRequestsViewModel-->>MyRequestsScreen: Updated list and notice
Possibly related PRs
- Silo-Server/silo-android#709: Introduced the Discover row flow that this change updates to apply removal events.
Suggested reviewers: quick104
Merge Risk: 
Low · previous review ad934
-
If a request changes and the list cannot refresh, Remove can remain available on the outdated row. This is a bounded issue to fix before merge or accept with owner awareness.
Security architecture risk: 
Moderate · up to ad934
-
The new removal action is capability-gated and limits eligibility, but it does not retain the originating signed-in context through transmission. An identity change before sending could apply the action under a different context. Whether that can delete an unintended request depends on server ownership checks that were not available for verification.
Retained concerns
- Medium · security · inferred: The confirmed removal carries a request ID but no originating server/account/profile snapshot. If identity changes before authentication and URL selection, the new DELETE can use the subsequent active authority. Repository reset prevents stale result publication but does not authority-bind the outbound mutation. Unintended deletion is conditional on the ID being meaningful and authorized in that subsequent scope; server enforcement and identifier isolation were not available to resolve that consequence.
Security review details
-
Security Blast Radius
- inferred — The identified exposure is a request-ID deletion under an unintended active authenticated scope, not demonstrated access to arbitrary tenants or administrative operations. Its consequence requires an identity-transition race and an ID that the receiving server accepts as removable under that authority. Server ownership and identifier-namespace behavior remain unverified.
Security Findings and Attack Paths
- inferred — A server-supplied record reaches confirmation as a MediaRequest, then becomes only an ID at the DELETE boundary. If the active identity changes before unpinned transport selection, that ID can be combined with the subsequent server and credentials. This supports an authority-binding concern, but does not establish a server authorization bypass or completed unintended deletion.
Trust Boundaries and Controls
- observed — The existing transport checks origin before attaching credentials, enforces cleartext-origin approval, and guards server changes during authentication and refresh. These controls constrain credential leakage and some transition races, but do not compare the selected authority with the owner of the confirmed request record.
Resilience and Maintainability Implications
- observed — Repository reset clears profile-scoped state and generation-gates late mutation publication. It deliberately returns the actual mutation result after reset rather than cancelling or binding the server operation. This preserves local state isolation but is not an outbound authorization invariant.
Hardening Proposals
- proposed — Bind the selected record and confirmation to an explicit originating authority, preserve that scope through URL and credential selection, and refuse dispatch when ownership changes. Establish the server's cross-account/profile rejection and identifier-isolation contract before relying on it as containment.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "feat(requests): let users remove their own failed requests" matches the main change in the changeset. The diff adds a Remove action for a user's failed requests that delivered nothing, on the phone/tablet My Requests screen and the Android TV Requests page, with server gating, a DELETE call, and confirmation. The title is specific and concise, and it names the scope (requests) and the action.
Full details: Linked Issues check
-
Explanation
PR
#792implements the coding requirements in directly linked issue#791.RequestsFeatureStatusandRequestsFeatureStoregate the action withremove_failed_supported.MediaRequest.isRemovableFailureexcludes requests with completed targets. Phone/tablet and TV surfaces provide confirmation, callDELETE /api/v2/requests/{id}, remove the row, update requestable state, and show removal feedback.MyRequestsViewModelhandles success, 409 refresh and explanation, disabled requests, and uncertain refresh results. Tests cover the API, capability flag, removal rule, view-model flows, and TV actions.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within issue
#791. Repository events and cache updates support removal across My Requests, search, discovery, and detail views. TV focus resolution supports the required behavior when a removed card disappears. Tests and dependency injection changes support the feature. No unrelated product area or server implementation is added.
Full details: Description check
-
Explanation
The pull request description clearly explains the failed-request removal feature, its server capability gate, affected Android surfaces, confirmation flow, error handling, focus behavior, and validation. It directly matches the changeset.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 12 functions across 18 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
| // A card that left the rows lost focus with them; one still listed lost it to the viewer. | ||
| focusMovedAway = locate(key) != null |
There was a problem hiding this comment.
Dialog focus loss prevents focus handoff after removal
Opening a removal dialog sets focusMovedAway before the card disappears, so focus falls back to the shell instead of moving to the next card. Distinguish dialog-induced focus loss from navigation away, or reset focusMovedAway when confirming removal.
Prompt for LLM
File androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/requests/TvRequestsPage.kt, lines 490-491:
Dialog focus loss prevents focus handoff after removal
Opening the removal dialogs moves focus away while the card is still present, setting `focusMovedAway` to true; when the removed card disappears, the successor-focus effect exits and focus falls back to the shell instead of the next card. Distinguish dialog-induced focus loss from the viewer navigating away, or reset the flag when confirming removal.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
Not a bug here: TvDialog draws in its own window, so opening the action or confirmation dialog doesn't clear the card's Compose focus, and onFocusChanged doesn't report a loss for the card while it's still in the rows. I checked this path on an Android TV emulator after adding focusMovedAway: long-press Verity, Remove request, confirm. Focus moved to Lupin, the card that took its place, both times. focusMovedAway only turns true when the card loses focus while it's still listed, for example when the viewer presses Up to the top bar before the answer arrives.
There was a problem hiding this comment.
Thanks for the explanation and emulator verification. I agree: if TvDialog leaves the card’s Compose focus intact, opening the dialog does not set focusMovedAway, so the successor-focus effect can run after removal.
The original suggestion appears to be a false positive. No change is needed.
| // Removed elsewhere since the list loaded: the re-read has dropped it. | ||
| result is ApiResult.Error && result.code == 404 -> settled |
There was a problem hiding this comment.
A failed refresh after a 404 silently leaves the deleted request visible
If fetch or refresh fails after a DELETE returns 404, the deleted request remains visible without an error. Check the refresh result and surface an error when the list cannot be reconciled.
Prompt for LLM
File shared/src/commonMain/kotlin/org/siloserver/silo/viewmodel/RequestsViewModels.kt, lines 544-545:
A failed refresh after a 404 silently leaves the deleted request visible
When DELETE returns 404 and the subsequent list refresh fails, the old row remains visible but this branch suppresses every error, leaving the user unable to tell why Remove did nothing. Check the refresh result and surface an error when the list could not be reconciled.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
Fixed in 02054ae. A 404 means another device already removed the request, so the repository now drops it from the lists just like after a 204, and My Requests rebuilds from that. The row goes away even when the re-read fails. Covered by a new view-model test (404 followed by a failed list read).
There was a problem hiding this comment.
Thanks for addressing this. Treating the 404 as an already-removed request and rebuilding the list from repository state addresses the reported stale-row case. The new test covers the important failure scenario.
|
The PR changes what users see: it adds a Remove action and confirmation/removal flow in My Requests on Android phone, tablet, and foldable (folded and open), and in Requests on Android TV. The evidence description identifies before/after captures for these devices. It does not identify the short recordings needed for the multi-step removal flow; please include recordings showing the confirmation, result, and title becoming requestable again on the phone app and TV, including the TV D-pad focus handoff when the removed card leaves. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
… fails A 404 on removal means another device already removed the request. Treat it like a 204 so the row leaves the list without waiting on the re-read.
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:
|
|
Added recordings to the evidence page (https://evidence.siloserver.org/r/silo-android/pr-792/, Recordings section).
Tablet and foldable (open and folded) use the same My Requests screen as the phone, and their before/after captures are on the same page. |
Problem
Closes #791
Related issue: Silo-Server/silo-server#3430 (server dependency)
Validation tasks: none
A failed request stays in the requests list, marked Failed, with no way to clear it. Cancel only works while a request is pending, and some failures can't be fixed by a retry, so those rows stay for good. This adds a Remove action for the viewer's own failed requests on the phone/tablet app and the Android TV app, matching the web app.
Approach
GET /api/v2/requests/statusreportsremove_failed_supported: true, so servers without feat(requests): let requesters remove their own failed requests silo-server#3430 see no change.DELETE /api/v2/requests/{id}runs, the row leaves every list, the title becomes requestable again, and "Request removed" confirms it.capability_disabled(requests turned off) says requests are off. A 404 means another device already removed it, so the row leaves the list as after a success.Validation
ReflowStyleTest > line height flows from settings, which also fails on unmodifiedmainon the build machine.Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/pr-792/
Surface and build: My Requests on an Android phone (Pixel 7), Android tablet (Pixel Tablet) and Android foldable (Pixel Fold, open and folded), and the Requests page on Android TV (1080p, Android 14), all emulators, plus recordings of the full flow on phone and on TV (D-pad only). Before is
origin/mainat7e4580db1, after is this branch, with the same seeded requests.Risks
None identified. Older servers never advertise
remove_failed_supported, so the action stays hidden.Checklist
AI Disclosure