Zackriya-Solutions/meetily · info

Download cancelled by user

Error message

Download cancelled by user

What it means

Returned when the engine's cancel_download_flag is set to the model currently being downloaded. This is deliberate control flow, not a malfunction: the writer is flushed, the partial file is intentionally kept on disk for a future resume, and the model is removed from the active downloads set.

Source

Thrown at frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs:841

            // Stream download
            use futures_util::StreamExt;
            let mut stream = response.bytes_stream();
            let mut file_downloaded = if resuming { existing_size } else { 0u64 };

            loop {
                // Check for cancellation before processing chunk
                {
                    let cancel_flag = self.cancel_download_flag.read().await;
                    if cancel_flag.as_ref() == Some(&model_name.to_string()) {
                        log::info!("Download cancelled for {}", model_name);
                        // Flush and keep partial file for resume on next attempt
                        let _ = writer.flush().await;
                        drop(writer);
                        // Remove from active downloads on cancellation
                        let mut active = self.active_downloads.write().await;
                        active.remove(model_name);
                        return Err(anyhow!("Download cancelled by user"));
                    }
                }

                // Add per-chunk timeout (30 seconds) to detect stalled connections
                let next_result = timeout(Duration::from_secs(30), stream.next()).await;

                let chunk = match next_result {
                    // Timeout - no data received for 30 seconds
                    Err(_) => {
                        log::warn!("Download timeout for {}: no data received for 30 seconds", model_name);
                        let _ = writer.flush().await;

                        // Remove from active downloads
                        {
                            let mut active = self.active_downloads.write().await;
                            active.remove(model_name);
                        }

View on GitHub (pinned to 0281737d87)

Solutions

  1. Map this error to a 'Cancelled' UI state in the caller — do not show it as a failure dialog
  2. Do not auto-retry a cancelled download; wait for the user to explicitly request it again
  3. Rely on the preserved partial file so the next attempt resumes instead of restarting from zero

Example fix

// caller: treat cancellation as a normal outcome
let res = engine.download_model("parakeet-mlx-0.6b-v3", None).await;
match res {
    Err(e) if e.to_string() == "Download cancelled by user" => {
        ui.set_state(DownloadState::Cancelled); // keep partial file for resume
    }
    Err(e) => ui.show_error(e),
    Ok(()) => ui.set_state(DownloadState::Done),
}
Defensive patterns

Strategy: try-catch

Try / catch

let res = engine.download_model(name, cb).await;
match res {
    Err(e) if e.to_string() == "Download cancelled by user" => Ok(Outcome::Cancelled), // not an error
    r => r.map(|_| Outcome::Done),
}

Prevention

When it happens

Trigger: Invoking the cancel-download flag/command while download is streaming chunks for that same model name; any task that sets cancel_download_flag to Some(model_name) while the download loop is between chunks.

Common situations: User clicks Cancel in the downloads UI; a settings screen cancels a pending fetch when switching engines; tests abort long downloads by setting the flag.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16). Data as JSON: /api/errors/c0b2476012977b4f. Report an issue: GitHub.