GRI-2014: accept non-blank timed-out renders, trim the frozen tail, end idle waits early #193

Merged
vivy merged 2 commits from fix/GRI-2014-pptx-trim-idle-end into dev 2026-11-14 14:07:38 +00:00
Member

Forge #189: implements the three items from the review decision on that issue (comment at 13:19).

  1. StillRunningAtTimeout with a non-blank recording is now success, not an error — only what was actually captured decides the outcome.
  2. The recording's trailing frozen tail (if any) is trimmed in place, keeping a short hold (2s) of the last real frame — a stream copy over a second freezedetect pass, so a short auto-timed deck gives a short video. A recording frozen from (near) its first frame, with no recovery ever, is still read as blank and still falls back.
  3. The wait now also ends early once the screen has shown the same frame for idle_end_seconds (default 10, SIGNAGE_PPTX_VIDEO_IDLE_END_SECONDS), racing that against the presenter — so a short deck does not cost a full render_timeout_seconds of render time.

Click-triggered steps stay out of this PR as agreed: such a deck now gives a short video of its first step, via the trim path above, rather than an error.

Tested with fake tools (the existing pattern in pptx_video.rs): timeout+blank→fallback, timeout+non-blank→trimmed success, idle-screen ending the wait before the render timeout, plus unit tests for the freeze-segment parsing/classification. Verified on this host with real tools against two real decks: both idle out and trim to ~3.2s videos (idle_end_seconds=6 for a fast check). A third deck (with a transition + entrance animation) was flaky on this host's X stack independent of this change — intermittently fails before ever going fullscreen, once with a panic inside x11rb-protocol's display-string parsing on a large random display number. Pre-existing (reserve_display/pptx_video_presenter are unchanged by this PR); noted on forge #189, not blocking this PR.

Test plan

  • cargo test -p server --lib pptx_video (19/19, including 3 new + updated timeout/trim/idle tests)
  • cargo test -p server --lib (189 passed)
  • cargo test -p server --test pptx_video_acceptance_integration -- --include-ignored (3/3, unchanged)
  • ./scripts/local-gates.sh --rust-only (clean)
  • Manual run on this host with real soffice/ffmpeg/Xvfb/gs against two real decks, confirming trim + idle-end end-to-end
Forge #189: implements the three items from the review decision on that issue (comment at 13:19). 1. `StillRunningAtTimeout` with a non-blank recording is now success, not an error — only what was actually captured decides the outcome. 2. The recording's trailing frozen tail (if any) is trimmed in place, keeping a short hold (2s) of the last real frame — a stream copy over a second `freezedetect` pass, so a short auto-timed deck gives a short video. A recording frozen from (near) its first frame, with no recovery ever, is still read as blank and still falls back. 3. The wait now also ends early once the screen has shown the same frame for `idle_end_seconds` (default 10, `SIGNAGE_PPTX_VIDEO_IDLE_END_SECONDS`), racing that against the presenter — so a short deck does not cost a full `render_timeout_seconds` of render time. Click-triggered steps stay out of this PR as agreed: such a deck now gives a short video of its first step, via the trim path above, rather than an error. Tested with fake tools (the existing pattern in `pptx_video.rs`): timeout+blank→fallback, timeout+non-blank→trimmed success, idle-screen ending the wait before the render timeout, plus unit tests for the freeze-segment parsing/classification. Verified on this host with real tools against two real decks: both idle out and trim to ~3.2s videos (idle_end_seconds=6 for a fast check). A third deck (with a transition + entrance animation) was flaky on this host's X stack independent of this change — intermittently fails before ever going fullscreen, once with a panic inside `x11rb-protocol`'s display-string parsing on a large random display number. Pre-existing (`reserve_display`/`pptx_video_presenter` are unchanged by this PR); noted on forge #189, not blocking this PR. ## Test plan - [x] `cargo test -p server --lib pptx_video` (19/19, including 3 new + updated timeout/trim/idle tests) - [x] `cargo test -p server --lib` (189 passed) - [x] `cargo test -p server --test pptx_video_acceptance_integration -- --include-ignored` (3/3, unchanged) - [x] `./scripts/local-gates.sh --rust-only` (clean) - [x] Manual run on this host with real `soffice`/`ffmpeg`/`Xvfb`/`gs` against two real decks, confirming trim + idle-end end-to-end
GRI-2014: accept a non-blank timed-out render, trim its frozen tail, and end the wait early when idle
Some checks failed
CI / the pre-push hook (pull_request) Successful in 7s
CI / cargo fmt (pull_request) Successful in 7s
CI / cargo deny (pull_request) Successful in 1m12s
CI / cargo clippy (pull_request) Successful in 2m21s
CI / cargo deny advisories (pull_request) Failing after 1m18s
CI / repository boundary (pull_request) Successful in 20s
CI / frontend-web (pull_request) Successful in 1m29s
CI / cargo test (pull_request) Successful in 4m6s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 16s
322e0f57a7
vivy requested changes 2026-11-14 13:50:15 +00:00
Dismissed
vivy left a comment

Review (Vivy): CI green, code reads well. Held for one change before merge.

Defect: idle-end cuts decks whose slides auto-advance after more than idle_end_seconds.
A slide with no animation, set in PowerPoint to advance after 15 s (<p:transition advTm="15000">), shows one unchanged frame for 15 s. watch_for_idle_screen ends the wait after 10 s, so the video stops on slide 1 and the rest of the deck is lost — silently, because the result is a valid non-blank MP4 and does not fall back to slide images. Signage decks are normally auto-timed, and 10–30 s per slide is common, so this is the common case, not an edge case.

Change asked:

  • Read each slide's auto-advance time from the .pptx before the render: ppt/slides/slideN.xml, attribute advTm (milliseconds) on p:transition (also inside mc:AlternateContent). Add the zip crate for this (default features off, deflate only), or reuse a zip reader that is already in the tree if there is one.
  • Effective idle limit = max(idle_end_seconds, longest advTm + 3 s), capped at render_timeout_seconds. A slide with no advTm is click-driven, and then idle_end_seconds applies as now.
  • If the zip cannot be read, use render_timeout_seconds as the idle limit (safe: slower, never truncates).
  • One unit test for the advTm parse (with and without mc:AlternateContent), one for the effective-limit rule.

Everything else (timeout + non-blank = success, trailing-freeze trim with a 2 s hold, Blank classification) is OK to merge as it is.

Review (Vivy): CI green, code reads well. **Held for one change before merge.** **Defect: idle-end cuts decks whose slides auto-advance after more than `idle_end_seconds`.** A slide with no animation, set in PowerPoint to advance after 15 s (`<p:transition advTm="15000">`), shows one unchanged frame for 15 s. `watch_for_idle_screen` ends the wait after 10 s, so the video stops on slide 1 and the rest of the deck is lost — silently, because the result is a valid non-blank MP4 and does not fall back to slide images. Signage decks are normally auto-timed, and 10–30 s per slide is common, so this is the common case, not an edge case. **Change asked:** - Read each slide's auto-advance time from the .pptx before the render: `ppt/slides/slideN.xml`, attribute `advTm` (milliseconds) on `p:transition` (also inside `mc:AlternateContent`). Add the `zip` crate for this (default features off, deflate only), or reuse a zip reader that is already in the tree if there is one. - Effective idle limit = `max(idle_end_seconds, longest advTm + 3 s)`, capped at `render_timeout_seconds`. A slide with no `advTm` is click-driven, and then `idle_end_seconds` applies as now. - If the zip cannot be read, use `render_timeout_seconds` as the idle limit (safe: slower, never truncates). - One unit test for the advTm parse (with and without `mc:AlternateContent`), one for the effective-limit rule. Everything else (timeout + non-blank = success, trailing-freeze trim with a 2 s hold, Blank classification) is OK to merge as it is.
GRI-2014: raise the idle bound to cover a slide's own auto-advance timing
Some checks failed
CI / the pre-push hook (pull_request) Successful in 40s
CI / cargo fmt (pull_request) Successful in 42s
CI / cargo deny (pull_request) Successful in 2m3s
CI / cargo deny advisories (pull_request) Failing after 2m1s
CI / cargo clippy (pull_request) Successful in 3m13s
CI / repository boundary (pull_request) Successful in 1m24s
CI / cargo test (pull_request) Successful in 4m19s
CI / frontend-web (pull_request) Successful in 2m13s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 19s
7fb17bba20
idle_end_seconds was a ceiling, not a floor: a slide held longer than the
10s default was cut off mid-hold, losing real content. Read the longest
advTm out of the .pptx's own ppt/slides/*.xml (it is a zip) and raise the
wait to cover it, plus a safety margin. A file that cannot be read as a
.pptx falls back to the full render_timeout_seconds instead of guessing.
vivy approved these changes 2026-11-14 14:07:23 +00:00
vivy left a comment

Re-review of 7fb17bba (Vivy): approved. The defect is fixed: effective_idle_after raises the idle bound to the longest advTm + 3 s, and an unreadable file falls back to render_timeout_seconds. The regex reads raw XML, so an advTm inside mc:AlternateContent is found too. zip >= 9 avoids GHSA-q7v9-x93c-xqv3; good catch.

Two notes, not blocking:

  • No cap at render_timeout_seconds. It does no harm, because the render timeout still ends the wait first in the select!.
  • read_to_string on a slide entry has no size limit, so a zip bomb in an upload could take a lot of memory. A .take(<a few MB>) on the entry would close that. Follow-up if you agree.
Re-review of 7fb17bba (Vivy): **approved.** The defect is fixed: `effective_idle_after` raises the idle bound to the longest `advTm` + 3 s, and an unreadable file falls back to `render_timeout_seconds`. The regex reads raw XML, so an `advTm` inside `mc:AlternateContent` is found too. zip >= 9 avoids GHSA-q7v9-x93c-xqv3; good catch. Two notes, not blocking: - No cap at `render_timeout_seconds`. It does no harm, because the render timeout still ends the wait first in the `select!`. - `read_to_string` on a slide entry has no size limit, so a zip bomb in an upload could take a lot of memory. A `.take(<a few MB>)` on the entry would close that. Follow-up if you agree.
vivy merged commit 7b862884d4 into dev 2026-11-14 14:07:38 +00:00
vivy deleted branch fix/GRI-2014-pptx-trim-idle-end 2026-11-14 14:07:39 +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!193
No description provided.