Finding
download_episode buffers the full episode response body in memory via response.bytes().await before writing it to disk, and the function is never invoked by any test. The fetch.rs test module only constructs FetchResult enum values as data; the download path itself (file creation, write_all, returned byte count) is never exercised.
Evidence
crates/komide/src/fetch.rs:71
pub async fn download_episode(
The body is read whole at crates/komide/src/fetch.rs:82:
No test file references download_episode; it is absent from all of komide's test modules.
Why this matters
Podcast episode files routinely run 50-300 MB. Buffering each one fully on the heap before writing means concurrent downloads multiply the process RAM footprint proportionally, an exhaustion vector on a memory-constrained handset. Independently, the correctness of the write path is unverified: a path-construction typo, a partial write from an interrupted future, or a zero-byte write would ship undetected because CI never calls the function, leaving user-facing content silently missing.
Desired correction
Replace response.bytes() with a streaming copy (tokio::io::copy between the response byte stream and the file) so the full body is never resident in memory. Add an integration test against a mock HTTP server (e.g. wiremock) that asserts (1) the file is created with the expected content and (2) the returned u64 equals the on-disk file size. Done when: download_episode no longer buffers the full body in memory and is exercised by at least one test.
Finding
download_episodebuffers the full episode response body in memory viaresponse.bytes().awaitbefore writing it to disk, and the function is never invoked by any test. Thefetch.rstest module only constructsFetchResultenum values as data; the download path itself (file creation,write_all, returned byte count) is never exercised.Evidence
crates/komide/src/fetch.rs:71The body is read whole at
crates/komide/src/fetch.rs:82:No test file references
download_episode; it is absent from all ofkomide's test modules.Why this matters
Podcast episode files routinely run 50-300 MB. Buffering each one fully on the heap before writing means concurrent downloads multiply the process RAM footprint proportionally, an exhaustion vector on a memory-constrained handset. Independently, the correctness of the write path is unverified: a path-construction typo, a partial write from an interrupted future, or a zero-byte write would ship undetected because CI never calls the function, leaving user-facing content silently missing.
Desired correction
Replace
response.bytes()with a streaming copy (tokio::io::copybetween the response byte stream and the file) so the full body is never resident in memory. Add an integration test against a mock HTTP server (e.g.wiremock) that asserts (1) the file is created with the expected content and (2) the returnedu64equals the on-disk file size. Done when:download_episodeno longer buffers the full body in memory and is exercised by at least one test.