{"record":{"id":"50bf2923d78fbd02","repo":"Zackriya-Solutions/meetily","slug":"model-is-currently-downloading","errorCode":null,"errorMessage":"Model {} is currently downloading","messagePattern":"Model (.+?) is currently downloading","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"frontend/src-tauri/src/whisper_engine/whisper_engine.rs","lineNumber":334,"sourceCode":"                };\n\n                // Update current context and model\n                *self.current_context.write().await = Some(ctx);\n                *self.current_model.write().await = Some(model_name.to_string());\n\n                // Enhanced acceleration status reporting\n                let acceleration_status = acceleration.status_label();\n\n                log::info!(\"Successfully loaded model: {} with {} (Performance Tier: {:?}, Beam Size: {}, Threads: {:?})\",\n                          model_name, acceleration_status, hardware_profile.performance_tier,\n                          adaptive_config.beam_size, adaptive_config.max_threads);\n                Ok(())\n            },\n            ModelStatus::Missing => {\n                Err(anyhow!(\"Model {} is not downloaded\", model_name))\n            },\n            ModelStatus::Downloading { .. } => {\n                Err(anyhow!(\"Model {} is currently downloading\", model_name))\n            },\n            ModelStatus::Error(ref err) => {\n                Err(anyhow!(\"Model {} has error: {}\", model_name, err))\n            },\n            ModelStatus::Corrupted { .. } => {\n                Err(anyhow!(\"Model {} is corrupted and cannot be loaded\", model_name))\n            }\n        }\n    }\n\n    pub async fn unload_model(&self) -> bool  {\n        let mut ctx_guard = self.current_context.write().await;\n        let unloaded = ctx_guard.take().is_some();\n        if unloaded {\n            log::info!(\"📉Whisper model unloaded\");\n        }\n\n        let mut model_name_guard = self.current_model.write().await;","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/whisper_engine/whisper_engine.rs#L316-L352","documentation":"Thrown by WhisperModelManager::load_model when the requested model's ModelStatus is Downloading. A download task is still streaming the ggml file to disk, so load is refused to prevent whisper.cpp from memory-mapping a partial file. The error clears once the download finishes and status becomes Available.","triggerScenarios":"Calling load_model (Tauri command load_whisper_model) for a model whose download_model call is still in progress; clicking Load in the UI while the progress callback reports < 100; retrying load immediately after starting a download.","commonSituations":"UI lets the user press Load while a download badge shows partial progress; app crashed or was killed mid-download leaving a stale Downloading status in the registry; automated test starts transcription before the model fetch completes.","solutions":["Wait for the download progress event to report 100 and the status to become Available, then retry load_model","If the status is stuck at Downloading after a crash/restart, call get_models (which rescans the registry/disk) or delete_model then download_model again","Disable the Load button in the UI while the model status is Downloading"],"exampleFix":"// before (frontend)\nawait invoke('load_whisper_model', { modelName }); // fails with 'currently downloading'\n\n// after\nconst models = await invoke<ModelInfo[]>('get_whisper_models');\nconst m = models.find(m => m.name === modelName);\nif (m?.status === 'Downloading') {\n  showToast('Model still downloading — wait for 100%');\n} else {\n  await invoke('load_whisper_model', { modelName });\n}","handlingStrategy":"validation","validationCode":"// Before load_model: check status via the model list command\nconst models = await invoke<Array<{ name: string; status: string }>>('get_whisper_models');\nconst m = models.find(x => x.name === modelName);\nif (!m || m.status !== 'Available') {\n  throw new Error(`Model not loadable yet (status: ${m?.status ?? 'unknown'})`);\n}\nawait invoke('load_whisper_model', { modelName });","typeGuard":"const isLoadable = (m: { status: string } | undefined): m is { status: 'Available' } =>\n  m?.status === 'Available';","tryCatchPattern":"try {\n  await invoke('load_whisper_model', { modelName });\n} catch (e) {\n  if (String(e).includes('currently downloading')) {\n    // subscribe to download progress; retry on 100%\n  } else { throw e; }\n}","preventionTips":["Subscribe to model download progress events and only enable Load when progress reaches 100","Refresh model statuses via get_whisper_models after app restart to clear stale Downloading states","Never fire load_model in the same handler as download_model; chain them with await"],"tags":["whisper","model-management","rust","tauri","download"],"backgroundTag":"resource-not-ready","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}