{"record":{"id":"9b8fa73b13f66d11","repo":"Zackriya-Solutions/meetily","slug":"progress-overflow-while-downloading","errorCode":null,"errorMessage":"Progress overflow while downloading {}","messagePattern":"Progress overflow while downloading (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs","lineNumber":1048,"sourceCode":"                };\n\n                let chunk_bytes = chunk.len() as u64;\n                let next_artifact_bytes = artifact_bytes\n                    .checked_add(chunk_bytes)\n                    .ok_or_else(|| anyhow!(\"{} size overflow\", artifact.filename))?;\n                if next_artifact_bytes > artifact.exact_bytes {\n                    writer.flush().await.map_err(|error| {\n                        anyhow!(\"Failed to preserve {} after overlong response: {}\", artifact.filename, error)\n                    })?;\n                    return Err(anyhow!(\n                        \"{} response exceeds its exact {} byte size\",\n                        artifact.filename,\n                        artifact.exact_bytes\n                    ));\n                }\n                let next_confirmed_bytes = confirmed_bytes\n                    .checked_add(chunk_bytes)\n                    .ok_or_else(|| anyhow!(\"Progress overflow while downloading {}\", artifact.filename))?;\n                if next_confirmed_bytes > total_bytes {\n                    return Err(anyhow!(\"Download progress exceeds the catalog total\"));\n                }\n\n                writer\n                    .write_all(&chunk)\n                    .await\n                    .map_err(|error| anyhow!(\"Failed to write {}: {}\", artifact.filename, error))?;\n                artifact_bytes = next_artifact_bytes;\n                confirmed_bytes = next_confirmed_bytes;\n                streamed_bytes = streamed_bytes\n                    .checked_add(chunk_bytes)\n                    .ok_or_else(|| anyhow!(\"Streamed byte count overflow\"))?;\n                bytes_since_report = bytes_since_report\n                    .checked_add(chunk_bytes)\n                    .ok_or_else(|| anyhow!(\"Progress byte count overflow\"))?;\n\n                let progress = Self::in_flight_progress(confirmed_bytes, total_bytes, 0.0);","sourceCodeStart":1030,"sourceCodeEnd":1066,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/a2cb62e827da7ef59f65064c97233efb2313878e/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L1030-L1066","documentation":"The global download progress counter (confirmed_bytes accumulated across all catalog artifacts) overflowed u64 via checked_add while downloading a model. Like the per-artifact overflow, this is an impossible condition in correct operation and signals corrupted progress-accounting state.","triggerScenarios":"confirmed_bytes, summed across all artifact downloads in the loop at parakeet_engine.rs:1046-1048, is corrupted (e.g. initialized from a bogus catalog total_bytes or resumed with wrong persisted progress) causing checked_add to wrap; the companion check also fails when next_confirmed_bytes > total_bytes.","commonSituations":"Corrupted persisted download-progress state on resume; catalog total_bytes miscomputed (smaller than the sum of artifact sizes) triggering the sibling 'progress exceeds catalog total' error; bug in progress aggregation code.","solutions":["Reset download progress state (delete partial files/progress metadata) and restart the download","Verify catalog total_bytes equals the sum of all artifact exact_bytes values","Restart the app to clear in-memory counters and retry","Report as a bug — internal accounting invariant was violated"],"exampleFix":"// before\nlet total_bytes: u64 = artifacts.iter().map(|a| a.exact_bytes).sum(); // unvalidated\n// after\nlet total: u64 = artifacts.iter().map(|a| a.exact_bytes)\n    .try_fold(0u64, u64::checked_add)\n    .ok_or_else(|| anyhow!(\"catalog total_bytes overflow\"))?;\nanyhow::ensure!(total == catalog.total_bytes, \"catalog total mismatch\");","handlingStrategy":"validation","validationCode":"// validate catalog totals before downloading\nlet sum: Option<u64> = catalog.artifacts.iter().map(|a| a.exact_bytes).try_fold(0u64, u64::checked_add);\nanyhow::ensure!(sum == Some(catalog.total_bytes), \"catalog total_bytes does not match artifact sizes\");","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"Progress overflow\") ||\n              e.to_string().contains(\"progress exceeds the catalog total\") => {\n        clear_progress_state();\n        restart_download_from_scratch()\n    }\n    other => other,\n}","preventionTips":["Compute total_bytes with checked arithmetic and validate against artifact sizes at catalog load time","Never resume from manually modified progress metadata","Treat progress overflow as an internal bug — reset state and report it"],"tags":["rust","integer-overflow","progress","download"],"backgroundTag":"internal-invariant-violation","analyzedSha":"a2cb62e827da7ef59f65064c97233efb2313878e","analyzedAt":"2026-09-12T11:12:14.152Z","contentChangedAt":"2026-09-12T11:12:14.152Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}