Automattic / Automattic/wordpress-rs

MediaFileUnreadable is documented more narrowly than it behaves

Open
#1,583 0 comments 0 reactions 1 assignee Claimed by @oguzkocer View on GitHub
Dominant language
Rust
Stars
36
Forks
5
Avg merge
17h 30m
Merged PRs (30d)
43

Description

The 0.7.0 changelog describes `MediaFileUnreadable` as a media file that "exists but fails *mid-read* while its multipart body is streamed". The Kotlin executor raises it in a wider set of cases.

The actual split is by phase rather than by open-vs-read:

- `MediaFileNotFound` is the pre-serialization check, at multipart-build time.
- `MediaFileUnreadable` covers everything once OkHttp starts writing the body — including a failure to *open* the file at that point (`WpRequestExecutor.kt:437-442`, where `file.source()` throwing `IOException` becomes `MediaFileUnreadableException`), not only a read failure partway through (`:450-458`).

So a file deleted between the multipart build and the body write is `MediaFileUnreadable` despite never having been opened.

Worth aligning the doc comment and changelog with the phase-based split.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.