diff --git a/Cargo.lock b/Cargo.lock index d64fdb2..989b0e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2245,7 +2245,7 @@ dependencies = [ [[package]] name = "pdf-presenter" -version = "0.1.68" +version = "0.1.69" dependencies = [ "bytemuck", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 5715118..0f7f2d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["crates/pdf-presenter"] resolver = "3" [workspace.package] -version = "0.1.68" +version = "0.1.69" edition = "2024" license = "MIT" repository = "https://proxy.dandaedre.com/gitea/idle-org/pdf-presenter" diff --git a/crates/pdf-presenter/tests/native.rs b/crates/pdf-presenter/tests/native.rs index e3d742e..838dcc5 100644 --- a/crates/pdf-presenter/tests/native.rs +++ b/crates/pdf-presenter/tests/native.rs @@ -615,7 +615,16 @@ fn wayland_browser_parents_to_presenter_before_first_buffer() { fn unsupported_sleep_backend_reports_unavailable_and_exits_on_parent_eof() { let output = run_native(&["--keep-awake"]); assert!(output.status.success()); - let status: String = serde_json::from_slice(&output.stdout).unwrap(); + let status: String = pdf_presenter::worker::read_json(&mut output.stdout.as_slice()).unwrap(); assert!(status.starts_with("Sleep protection unavailable:")); assert!(status.contains(std::env::consts::OS)); } + +#[test] +fn keep_awake_status_uses_private_length_prefixed_json() { + let mut framed = Vec::new(); + pdf_presenter::worker::write_json(&mut framed, &"Sleep protection test").unwrap(); + assert!(serde_json::from_slice::(&framed).is_err()); + let decoded: String = pdf_presenter::worker::read_json(&mut framed.as_slice()).unwrap(); + assert_eq!(decoded, "Sleep protection test"); +} diff --git a/docs/changelog.md b/docs/changelog.md index 4777e3f..469aff7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,14 @@ ## Unreleased +### 0.1.69 + +- Decode the unsupported-platform keep-awake child status with the private + length-prefixed JSON protocol used by the application. This fixes the FreeBSD CI + test that incorrectly treated the framed bytes as plain JSON; production sleep + behavior is unchanged. Linux checks pass with 84.44% whole-application coverage; + the release binary is rebuilt. + ### 0.1.68 - Keep large arrows clean and proportional: shorten the shaft beneath a filled,