{"record":{"id":"6b3569bcb9713bdc","repo":"Zackriya-Solutions/meetily","slug":"size-overflow","errorCode":null,"errorMessage":"{} size overflow","messagePattern":"(.+?) size overflow","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs","lineNumber":1035,"sourceCode":"                    }\n                    Ok(None) => break,\n                    Ok(Some(Err(error))) => {\n                        writer.flush().await.map_err(|flush_error| {\n                            anyhow!(\n                                \"Failed to preserve {} after stream error: {}\",\n                                artifact.filename,\n                                flush_error\n                            )\n                        })?;\n                        return Err(anyhow!(\"Download stream failed for {}: {}\", artifact.filename, error));\n                    }\n                    Ok(Some(Ok(chunk))) => chunk,\n                };\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","sourceCodeStart":1017,"sourceCodeEnd":1053,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/a2cb62e827da7ef59f65064c97233efb2313878e/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L1017-L1053","documentation":"The running byte counter for a downloaded artifact (artifact_bytes + chunk_bytes, computed with u64::checked_add) overflowed, which is mathematically impossible in a correct transfer. The code treats this as an internal invariant violation and aborts, because it indicates corrupted accounting state rather than a network problem.","triggerScenarios":"artifact_bytes or chunk_bytes are corrupted (e.g. chunk.len() misreported, artifact_bytes initialized from a bogus resume offset near u64::MAX) so checked_add wraps in the loop at parakeet_engine.rs:1033-1035.","commonSituations":"A buggy resume path seeding artifact_bytes with a wrong/huge persisted offset; memory corruption or an incorrectly deserialized download-state file; artificial test injection of extreme values.","solutions":["Clear the partially downloaded model file and download-state so the resume offset resets to 0","Check the persisted resume metadata (byte offset) is a sane value < exact_bytes","Restart the app to reset in-memory counters and retry the download","Report as a bug with logs — this indicates corrupted internal state"],"exampleFix":"// before\n.ok_or_else(|| anyhow!(\"{} size overflow\", artifact.filename))?;\n// after\n// validate resume offset when loading state:\nanyhow::ensure!(resume_offset <= artifact.exact_bytes, \"corrupt resume offset for {}\", artifact.filename);","handlingStrategy":"validation","validationCode":"// validate persisted resume offset before resuming\nlet offset: u64 = load_resume_offset(artifact_id)?;\nanyhow::ensure!(offset <= artifact.exact_bytes, \"corrupt resume offset for {}\", artifact.filename);","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"size overflow\") => {\n        // corrupted accounting: reset state and restart download cleanly\n        clear_download_state();\n        restart_download_from_scratch()\n    }\n    other => other,\n}","preventionTips":["Never hand-edit persisted download-state/offset files","Keep resume metadata and partial files in sync (delete both together)","Treat overflow errors as bugs — report with logs rather than retrying blindly"],"tags":["rust","integer-overflow","invariant","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-14T05:17:10.506Z"}