Skip to content

fix(downloads): show why a series or episode download didn't start - #429

Merged
Quick104 merged 1 commit into
Silo-Server:mainfrom
rangoDJ:fix/series-download-failure-message-424
Oct 2, 2026
Merged

Quick104 merged 1 commit into
Silo-Server:mainfrom
rangoDJ:fix/series-download-failure-message-424

Conversation

@rangoDJ

@rangoDJ rangoDJ commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #424
Related server PR: Silo-Server/silo-server#1704. The two are independent and can merge in either order: that PR stops the server from rejecting a series download when a slot is free, and this one shows the reason whenever it does reject one.

"Download series" called the server's batch endpoint and dropped the result. When the server refused the batch, for example with 429 rate_limited because download.max_concurrent_per_user was reached, nothing was queued and nothing was shown, so the button looked broken. Single-episode downloads already emitted a success/failure event, which only drove a haptic, and showed no reason.

Approach

  • ItemDetailViewModel.reportDownloadStart handles both paths: it emits the existing start event and, for a failed request, the server's error message through ApiResult.errorMessage, falling back to "Couldn't start the download.".
  • onSeriesDownloadTapped now passes the batch result to it instead of ignoring it.
  • ItemDetailScreen collects the new downloadFailureMessages flow and shows each message in a long toast, like the screen's other download toasts.

Validation

Run in WSL2 with JDK 21 and Android SDK 36:

  • ./gradlew :androidApp:testDebugUnitTest :androidApp:assembleDebug: passed. The two compiler warnings are in the existing SettingsViewModelOfflinePreferencesTest.
  • ./gradlew :androidApp:lintDebug: passed.
  • I haven't run it on a device. The failure it reports was reproduced earlier on a phone with adb: the batch request got 429 rate_limited and the screen showed nothing.

Risks

  • A failed single-episode download now also shows a toast, where before it only gave the reject haptic.
  • "Download series" now gives the same confirm or reject haptic as a single download, since it goes through the start event too.
  • The message is the server's text when it sends one, so its wording follows the server.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (Claude desktop app, Code tab)
  • Tool(s): Claude Code, GitHub CLI, Gradle, adb
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: Self-review. It checked that the series path previously discarded the ApiResult, that errorMessage is the helper other screens already use for server messages, that the new flow is collected once per screen like downloadStartEvents, and that no string resources were bypassed (the screen's other toasts use literal text too).

🤖 Generated with Claude Code

Note

Show a toast when a series or episode download fails to start

Adds user-facing error messages when a download-start request fails.

  • New reportDownloadStart helper in ItemDetailViewModel emits an error message derived from the ApiResult alongside the existing success/failure start event, with a fallback message when no error text is available
  • startDownload and onSeriesDownloadTapped both route their enqueue results through this helper, so series batch failures are reported too
  • ItemDetailScreen collects the failure-message flow and shows each message in a long-duration toast
  • Behavioral Change: failed download starts now show a toast in addition to the existing unsuccessful start event

Macroscope summarized e85772e.

"Download series" ignored the batch endpoint's result, so a request the
server rejected (such as the concurrent download limit) looked like
nothing happened. Single downloads only reported success or failure.

Both now report the start, and a rejected request shows the server's
message in a toast, with a fallback when it has none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kody-ai

kody-ai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Access your configuration settings here.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a0403e22-2b93-4c15-8186-cc2580c4f4f4

📥 Commits

Reviewing files that changed from the base of the PR and between e24d9e1 and e85772e.

📒 Files selected for processing (2)
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailViewModel.kt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The detail screen now displays download-start failure messages in long-duration toasts. The view model reports failed individual and series batch download-start requests with the API error message or a fallback.

Changes

Download failure reporting

Layer / File(s) Summary
Publish and display download failures
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailViewModel.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/detail/ItemDetailScreen.kt
The view model emits a failure message when a download-start request fails. The series batch-start path uses the same reporting helper. The detail screen shows collected messages in long-duration toasts.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: quick104

Merge Risk: ⚪ Minimal · up to e8577

Download-start failures reach the detail screen as server, network, or fallback messages while it is active. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: showing the reason when a series or episode download does not start.
Description check ✅ Passed The description directly explains the download failure feedback change, its implementation, validation, and behavior differences.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@Quick104
Quick104 merged commit 6f1a366 into Silo-Server:main Oct 2, 2026
6 checks passed
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.

2 participants