Skip to content

feat: retry (resuming) or remove failed downloads - #10

Merged
ghostcoder42 merged 1 commit into
mainfrom
feature/download-retry
Sep 5, 2026
Merged

ghostcoder42 merged 1 commit into
mainfrom
feature/download-retry

Conversation

@ghostcoder42

Copy link
Copy Markdown
Owner

A failed download used to leave the library row with a single dead "cancel" button and silently blocked the watch-page retry behind an "already active" guard. Now:

  • failed tasks keep their resumable; Retry resumes from the bytes already on disk (resumeAsync + Range — the signed CDN URLs support it) instead of restarting from zero, with the progress bar continuing where it stopped
  • when resuming is not possible (no resumable yet, expired signed URL, range rejected) retry falls back to a fresh download with a re-resolved source; if no source can be resolved the task stays errored and Delete removes it along with its partial file
  • the watch-page button is store-driven (progress/error/in-flight read from the task store) so it shows the same story as the library row and tile badges, and its retry actually works now
  • the long-press menu offers "Retry download" for errored tiles; every fresh download still starts clean (partial file deleted first — never append blindly)

@ghostcoder42
ghostcoder42 force-pushed the feature/download-retry branch 3 times, most recently from a627a7c to f37d720 Compare September 5, 2026 10:23
Failed downloads could previously neither be retried nor removed (a
single dead "cancel" button), and killing the app mid-download lost
the task AND its partial file to the startup orphan cleanup. Now:

- downloading tasks have a Pause button; pausing stops the native task
  at a clean boundary (pauseAsync) and the row shows Paused with
  Resume/Delete — useful to prioritise bandwidth across tasks
- Retry/Resume continues from the bytes already on disk (resumeAsync +
  Range) — verified on device with HTTP 206 responses — instead of
  restarting from zero, and the progress bar continues where it stopped
- the task table is persisted (MMKV); on startup, tasks that died with
  the process are restored as errored ("interrupted") while
  user-paused ones stay paused, and the orphan cleanup spares their
  partial files (the on-disk size is the resume offset — the native
  layer truncates to it and sends Range: bytes=<size>-)
- when resuming is impossible (expired signed URL, range rejected, no
  source) retry falls back to a fresh download with a re-resolved
  source; if no source resolves the task stays errored and Delete
  removes it with its partial file
- the watch-page button is store-driven (same story as the library row
  and tile badges) and its retry works; the long-press menu offers
  "Retry/Resume download" for errored/paused tiles
@ghostcoder42
ghostcoder42 force-pushed the feature/download-retry branch from f37d720 to 0515aed Compare September 5, 2026 10:26
@ghostcoder42
ghostcoder42 merged commit 66d4acd into main Sep 5, 2026
1 check passed
@ghostcoder42
ghostcoder42 deleted the feature/download-retry branch September 5, 2026 10:30
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.

1 participant