recloudstream / recloudstream/cloudstream
Downloader breaks on network interruption — no retry, broken resume, lost metadata, ghost buttons
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 10.7k
- Forks
- 1.1k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 15
Description
Steps to reproduce
- Start downloading any episode, movie
- Turn off WiFi mid-download
- Turn WiFi back on
- Download fails and download button is unresponsive
- Force stop app, reopen, tap Resume — nothing happens
- Switch to another app and back, tap Resume — still nothing
- Progress shows X MB / 0 KB
Expected behavior
Download should automatically retry or resume when network is restored.
Progress metadata (total file size) should be preserved on interruption.
Resume button should either work or show a clear error message.
Actual behavior
Bug 1: Download dies permanently on WiFi drop, no retry attempted, button becomes unresponsive.
Bug 2: After force stop + reopen, Resume button shows but tapping does nothing.
Zero network activity in logcat — stored URL has likely expired (Cloudflare Workers
temporary signed URL) and app silently fails with no user feedback.
Bug 3: Progress shows "10 MB / 0 KB" — totalBytes metadata is lost on interruption,
making resume calculation impossible.
Bug 4: After backgrounding and returning to app, Resume button appears active but
does nothing — DownloadQueueService was killed by Android but UI was never updated.
Cloudstream version and commit hash
4.6.2-PRE - 1fb6ce3
Android version
15
Logcat
Some important logs
java.net.SocketException: Software caused connection abort
java.net.UnknownHostException: Unable to resolve host "worker-shiny-sun-14b1.xesitif709.workers.dev"
java.net.ConnectException: failed to connect to /188.114.97.7 (port 443): ENETUNREACH (Network is unreachable)
Other details
Root cause analysis:
- No SocketException/ConnectException catch with retry logic in the download loop
- Expired URLs are not re-extracted on resume — stored URL used blindly
- totalBytes not written to disk atomically with chunk data
- DownloadQueueService lifecycle not synced back to UI on app resume
Suggested fix: Add external downloader support (1DM, ADM) via Android Intent
as a setting. These apps handle retry, resume, metadata and background correctly.
Would be a useful workaround while the internal downloader is improved.
Device: Mali GPU.
Acknowledgements
- I am sure my issue is related to the app and NOT some extension.
- I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
- I have written a short but informative title.
- I have updated the app to pre-release version Latest.
- I will fill out all of the requested information in this form.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing DownloadQueueService and the UI state used for Resume, then reproduce the interruption and force-stop flows with the supplied logcat errors. Check how URLs, totalBytes, and service lifecycle state are persisted. Done means interrupted downloads retry or resume, preserve progress metadata, refresh expired URLs as needed, and give clear feedback when resuming fails.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile, networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100