Skip to content

Download refactor#158

Merged
gabrielste1n merged 2 commits intomainfrom
download-refactor
Jan 27, 2026
Merged

Download refactor#158
gabrielste1n merged 2 commits intomainfrom
download-refactor

Conversation

@gabrielste1n
Copy link
Copy Markdown
Collaborator

@gabrielste1n gabrielste1n commented Jan 27, 2026

Summary

  • Consolidated three duplicate download implementations (whisper.js, parakeet.js, modelManagerBridge.js) into a shared downloadUtils.js module, removing ~650 lines of redundant code
  • Added download resume support — partial .tmp files are detected and resumed via HTTP Range headers, with automatic fallback if the server doesn't support Range
  • Added retry with exponential backoff — transient network errors (ECONNRESET, ETIMEDOUT, etc.) are retried up to 3 times with capped backoff
  • Replaced flag-based cancellation with abort signal pattern — new createDownloadSignal() provides a clean, reusable abort mechanism used by all three download paths
  • Added "Installing" UI state for Parakeet — after download completes, the progress bar shows "Installing [model]..." with a pulsing animation during tar.bz2 extraction, instead of appearing stuck at 100%
  • Added client-side progress throttle for whisper/parakeet — matches the existing LLM handler throttle to prevent UI flashing from high-frequency IPC updates
  • Simplified IPC handlers — removed redundant try/catch wrappers in ipcHandlers.js that duplicated error/completion events; errors now propagate naturally as rejected IPC promises
  • Extracted LocalModelCard to a standalone function component — moved out of the render body in TranscriptionModelPicker to avoid re-creation on every render
  • Pre-resolves redirects — HEAD request resolves CDN redirect chains once before downloading, avoiding per-chunk redirect overhead
  • Atomic file writes — downloads write to .tmp then rename, with EXDEV cross-device fallback for Windows/Linux edge cases

@gabrielste1n gabrielste1n merged commit f0493bb into main Jan 27, 2026
4 checks passed
@gabrielste1n gabrielste1n deleted the download-refactor branch January 27, 2026 19:13
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