GRI-2014: gate the .pptx MP4 render behind config, default off, and fix the presenter/idle race #196

Merged
vivy merged 2 commits from fix/GRI-2014-pptx-mp4-flag-fallback into dev 2026-11-14 16:08:47 +00:00
Member

What

Step 1 of the 15:3x decision on forge #189, given Monday's campus deadline:

  1. A config gate, default off. PptxVideoConfig.mp4_enabled: bool (default false, SIGNAGE_PPTX_VIDEO_MP4_ENABLED, GRI-1884-compliant). convert_pptx only tries render_to_mp4 when it's true — otherwise every .pptx upload goes straight to the slide-image fallback.
  2. The presenter/idle race, fixed. render_to_mp4's tokio::select! races run_presenter (reports "never went fullscreen" only after the full render_timeout_seconds) against watch_for_idle_screen (reports idle after the much shorter idle_end_seconds). A deck stuck on its loading screen is just as "idle" as one that finished normally, so idle always won and the presenter's Err was silently dropped. Fixed: pptx_video_presenter now prints FULLSCREEN to stdout the instant it first observes fullscreen; run_presenter reads that live and sets a shared signal; watch_for_idle_screen will not start its stillness count until that signal is set, so a presenter that never reaches fullscreen can only be resolved by its own, eventual Err.

Testing

  • cargo test -p server --lib pptx_video — 25/25, including a new regression test (a_presenter_that_never_reaches_fullscreen_is_not_overridden_by_an_idle_screen) that fails against the pre-fix code.
  • cargo test -p server --lib config:: — 19/19, including the new mp4_enabled default/env-override test.
  • New acceptance test mp4_is_off_by_default_the_upload_still_falls_back_to_pages.
  • ./scripts/local-gates.sh --rust-only: every gate passed.

Forge #189 stays open: step 2 (root cause of the real-host blank render, content-based acceptance check) is separate, unstarted work.

## What Step 1 of the 15:3x decision on forge #189, given Monday's campus deadline: 1. **A config gate, default off.** `PptxVideoConfig.mp4_enabled: bool` (default `false`, `SIGNAGE_PPTX_VIDEO_MP4_ENABLED`, GRI-1884-compliant). `convert_pptx` only tries `render_to_mp4` when it's `true` — otherwise every `.pptx` upload goes straight to the slide-image fallback. 2. **The presenter/idle race, fixed.** `render_to_mp4`'s `tokio::select!` races `run_presenter` (reports "never went fullscreen" only after the *full* `render_timeout_seconds`) against `watch_for_idle_screen` (reports idle after the much shorter `idle_end_seconds`). A deck stuck on its loading screen is just as "idle" as one that finished normally, so idle always won and the presenter's `Err` was silently dropped. Fixed: `pptx_video_presenter` now prints `FULLSCREEN` to stdout the instant it first observes fullscreen; `run_presenter` reads that live and sets a shared signal; `watch_for_idle_screen` will not start its stillness count until that signal is set, so a presenter that never reaches fullscreen can only be resolved by its own, eventual `Err`. ## Testing - `cargo test -p server --lib pptx_video` — 25/25, including a new regression test (`a_presenter_that_never_reaches_fullscreen_is_not_overridden_by_an_idle_screen`) that fails against the pre-fix code. - `cargo test -p server --lib config::` — 19/19, including the new `mp4_enabled` default/env-override test. - New acceptance test `mp4_is_off_by_default_the_upload_still_falls_back_to_pages`. - `./scripts/local-gates.sh --rust-only`: every gate passed. Forge #189 stays open: step 2 (root cause of the real-host blank render, content-based acceptance check) is separate, unstarted work.
GRI-2014: gate the .pptx MP4 render behind config, default off, and fix the presenter/idle race
Some checks failed
CI / the pre-push hook (pull_request) Successful in 7s
CI / cargo fmt (pull_request) Successful in 7s
CI / cargo clippy (pull_request) Successful in 2m5s
CI / cargo deny (pull_request) Successful in 2m9s
CI / cargo deny advisories (pull_request) Failing after 2m18s
CI / repository boundary (pull_request) Successful in 36s
CI / cargo test (pull_request) Failing after 3m46s
CI / frontend-web (pull_request) Successful in 1m41s
CI / Notify gate failed (pull_request) Successful in 20s
CI / CI (pull_request) Failing after 21s
02e8b12843
PptxVideoConfig.mp4_enabled (default false, SIGNAGE_PPTX_VIDEO_MP4_ENABLED)
keeps every upload on the slide-image fallback until it is switched on.

Separately: pptx_video_presenter now reports fullscreen over stdout as it
happens, and watch_for_idle_screen waits for that signal before it will
ever declare the screen idle — closing the race where a presenter stuck
on its loading screen read as a successful idle render well before its
own, much slower, deadline-bound failure could surface.
Owner

Review (vivy, 15:5x): held — cargo test is red, and it is the new test, not the product code.

Reproduced locally on 02e8b12 with Postgres: mp4_is_off_by_default_the_upload_still_falls_back_to_pages fails with 400 invalid_pptx: the deck produced no pages. The other 3 acceptance tests and all 25 pptx_video unit tests pass.

Cause: the test starts from fake_successful_render_opts, whose fake soffice only runs sleep 30 and writes no PDF, and whose rasterizer is the default one. So the fallback path has no pages. Fix: take soffice_path and rasterizer_path from fallback_only_opts. With this patch, 4/4 pass:

diff --git a/crates/server/tests/pptx_video_acceptance_integration.rs b/crates/server/tests/pptx_video_acceptance_integration.rs
index d102787..a1d4fa3 100644
--- a/crates/server/tests/pptx_video_acceptance_integration.rs
+++ b/crates/server/tests/pptx_video_acceptance_integration.rs
@@ -346,6 +346,9 @@ async fn mp4_is_off_by_default_the_upload_still_falls_back_to_pages() {
     };
     let scratch = tempfile::tempdir().expect("make a scratch dir for the fake tools");
     let mut opts = fake_successful_render_opts(scratch.path());
+    let fallback = fallback_only_opts(scratch.path());
+    opts.soffice_path = fallback.soffice_path;
+    opts.rasterizer_path = fallback.rasterizer_path;
     opts.mp4_enabled = false;
     let server = spawn(fresh_pool(&url).await, opts).await;
     let cookie = signed_in_session(server.addr).await;

Please apply it, push, and I merge on green. The gate and the race fix themselves look right to me.

Review (vivy, 15:5x): **held — `cargo test` is red, and it is the new test, not the product code.** Reproduced locally on `02e8b12` with Postgres: `mp4_is_off_by_default_the_upload_still_falls_back_to_pages` fails with `400 invalid_pptx: the deck produced no pages`. The other 3 acceptance tests and all 25 `pptx_video` unit tests pass. Cause: the test starts from `fake_successful_render_opts`, whose fake `soffice` only runs `sleep 30` and writes no PDF, and whose rasterizer is the default one. So the fallback path has no pages. Fix: take `soffice_path` and `rasterizer_path` from `fallback_only_opts`. With this patch, 4/4 pass: ```diff diff --git a/crates/server/tests/pptx_video_acceptance_integration.rs b/crates/server/tests/pptx_video_acceptance_integration.rs index d102787..a1d4fa3 100644 --- a/crates/server/tests/pptx_video_acceptance_integration.rs +++ b/crates/server/tests/pptx_video_acceptance_integration.rs @@ -346,6 +346,9 @@ async fn mp4_is_off_by_default_the_upload_still_falls_back_to_pages() { }; let scratch = tempfile::tempdir().expect("make a scratch dir for the fake tools"); let mut opts = fake_successful_render_opts(scratch.path()); + let fallback = fallback_only_opts(scratch.path()); + opts.soffice_path = fallback.soffice_path; + opts.rasterizer_path = fallback.rasterizer_path; opts.mp4_enabled = false; let server = spawn(fresh_pool(&url).await, opts).await; let cookie = signed_in_session(server.addr).await; ``` Please apply it, push, and I merge on green. The gate and the race fix themselves look right to me.
GRI-2014: fix the fallback tools used by the mp4-off acceptance test
Some checks failed
CI / the pre-push hook (pull_request) Successful in 11s
CI / cargo fmt (pull_request) Successful in 13s
CI / cargo deny (pull_request) Successful in 1m42s
CI / cargo deny advisories (pull_request) Failing after 1m43s
CI / cargo clippy (pull_request) Successful in 1m56s
CI / repository boundary (pull_request) Successful in 55s
CI / frontend-web (pull_request) Successful in 1m47s
CI / cargo test (pull_request) Successful in 3m49s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 13s
66a83bcf3a
mp4_is_off_by_default_the_upload_still_falls_back_to_pages took its
soffice_path/rasterizer_path from fake_successful_render_opts, whose
fake soffice is a no-op daemon for the MP4 path and never writes a
PDF. With mp4_enabled off, the upload takes the fallback-conversion
path instead, so it needs the soffice/gs pair that actually produces
one -- the same pair fallback_only_opts already builds.
vivy merged commit 422683ae96 into dev 2026-11-14 16:08:47 +00:00
vivy deleted branch fix/GRI-2014-pptx-mp4-flag-fallback 2026-11-14 16:08:48 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!196
No description provided.