Skip to content

feat(downloads): resumable downloads with pause that survive app restarts - #14

Merged
ghostcoder42 merged 1 commit into
mainfrom
feat/resumable-downloads
Oct 14, 2026
Merged

ghostcoder42 merged 1 commit into
mainfrom
feat/resumable-downloads

Conversation

@ghostcoder42

Copy link
Copy Markdown
Owner
  • downloading tasks have a Pause button; pausing parks the native task at a clean boundary (pauseAsync) and the row shows Paused with Resume/Delete — the progress bar resumes where it stopped
  • Retry/Resume continues from the bytes already on disk (resumeAsync + Range) instead of restarting from zero; after an app restart the partial file's size rebuilds the resumable (the native layer truncates to it and sends Range: bytes=-)
  • user-paused tasks stay paused across restarts; tasks that died with the process come back as errored ("Interrupted"); the orphan cleanup now spares partial files of unfinished tasks (hydrate restores tasks before reconciling, so the resume points survive)
  • when resuming is impossible (expired source URL, range rejected), retry falls back to a fresh download with a re-resolved source
  • cancelling an errored/paused task deletes its partial file too
  • the post-page download button is store-driven (same story as the library row and tile badges), so its retry/resume works; the long-press menu offers "Resume download" for errored/paused tiles

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

💯 Test Coverage

Lines Statements Branches Functions
Coverage: 58%
58.08% (1106/1904) 51.5% (635/1233) 47.48% (274/577)

😎 Tests Results

Tests Skipped Failures Errors Time
327 0 💤 0 ❌ 0 🔥 14.007s ⏱️
👀 Tests Details • (58%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files58.0851.547.4858.5 
src/app/(app)4.833.014.24.95 
   _layout.tsx000020–103
   library.tsx000022–448
src/components7589.3954.5475.67 
   video-tile.tsx86.3693.8710085.7171, 76–77
src/lib/download62.4358.8755.5563.1 
   download-video.ts73.1362.9258.3374.0143–47, 60, 64–69, 128–131, 195, 214, 241, 277–287, 310, 315–323, 339–350
   index.ts39.6838.8853.334049–72, 94–97, 112–115, 129–161
src/lib/hooks58.4243.7571.7357.64 
   use-video-actions.ts37.2510.3472.7231.741–42, 57–93, 103–122
   use-video-download.ts68.9641.0210069.2357, 62–63, 90–97
src/lib/stores96.2394.4494.9397.4 
   active-downloads-store.ts95.3188100100144–165
   downloaded-store.ts92.5910085.7191.346–47

@ghostcoder42
ghostcoder42 force-pushed the feat/resumable-downloads branch 2 times, most recently from 53a1f7a to a8083ba Compare October 14, 2026 21:17
…arts

- downloading tasks have a Pause button; pausing parks the native task
  at a clean boundary (pauseAsync) and the row shows Paused with
  Resume/Delete — the progress bar resumes where it stopped
- Retry/Resume continues from the bytes already on disk (resumeAsync +
  Range) instead of restarting from zero; after an app restart the
  partial file's size rebuilds the resumable (the native layer truncates
  to it and sends Range: bytes=<size>-)
- user-paused tasks stay paused across restarts; tasks that died with
  the process come back as errored ("Interrupted"); the orphan cleanup
  now spares partial files of unfinished tasks (hydrate restores tasks
  before reconciling, so the resume points survive)
- when resuming is impossible (expired source URL, range rejected),
  retry falls back to a fresh download with a re-resolved source
- cancelling an errored/paused task deletes its partial file too
- the post-page download button is store-driven (same story as the
  library row and tile badges), so its retry/resume works; the
  long-press menu offers "Resume download" for errored/paused tiles
@ghostcoder42
ghostcoder42 force-pushed the feat/resumable-downloads branch from a8083ba to f71503d Compare October 14, 2026 21:24
@ghostcoder42
ghostcoder42 merged commit bb69e48 into main Oct 14, 2026
1 check passed
@ghostcoder42
ghostcoder42 deleted the feat/resumable-downloads branch October 14, 2026 21:28
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