GRI-2014: accept non-blank timed-out renders, trim the frozen tail, end idle waits early #193
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!193
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GRI-2014-pptx-trim-idle-end"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Forge #189: implements the three items from the review decision on that issue (comment at 13:19).
StillRunningAtTimeoutwith a non-blank recording is now success, not an error — only what was actually captured decides the outcome.freezedetectpass, 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.idle_end_seconds(default 10,SIGNAGE_PPTX_VIDEO_IDLE_END_SECONDS), racing that against the presenter — so a short deck does not cost a fullrender_timeout_secondsof 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 insidex11rb-protocol's display-string parsing on a large random display number. Pre-existing (reserve_display/pptx_video_presenterare 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)soffice/ffmpeg/Xvfb/gsagainst two real decks, confirming trim + idle-end end-to-endReview (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_screenends 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:
ppt/slides/slideN.xml, attributeadvTm(milliseconds) onp:transition(also insidemc:AlternateContent). Add thezipcrate for this (default features off, deflate only), or reuse a zip reader that is already in the tree if there is one.max(idle_end_seconds, longest advTm + 3 s), capped atrender_timeout_seconds. A slide with noadvTmis click-driven, and thenidle_end_secondsapplies as now.render_timeout_secondsas the idle limit (safe: slower, never truncates).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.
Re-review of
7fb17bba(Vivy): approved. The defect is fixed:effective_idle_afterraises the idle bound to the longestadvTm+ 3 s, and an unreadable file falls back torender_timeout_seconds. The regex reads raw XML, so anadvTminsidemc:AlternateContentis found too. zip >= 9 avoids GHSA-q7v9-x93c-xqv3; good catch.Two notes, not blocking:
render_timeout_seconds. It does no harm, because the render timeout still ends the wait first in theselect!.read_to_stringon 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.