fix(studio): surface a render panic instead of caching an empty frame - #257
Closed
LeadcodeDev wants to merge 1 commit into
Closed
LeadcodeDev wants to merge 1 commit into
LeadcodeDev wants to merge 1 commit into
Conversation
53 tasks
LeadcodeDev
force-pushed
the
fix/studio-stale-write
branch
from
September 22, 2026 06:11
a1e6edb to
3ba4914
Compare
LeadcodeDev
force-pushed
the
fix/studio-render-panic
branch
from
September 22, 2026 06:11
452e5aa to
70fc5c6
Compare
LeadcodeDev
force-pushed
the
fix/studio-stale-write
branch
from
September 22, 2026 08:35
3ba4914 to
64683cc
Compare
LeadcodeDev
force-pushed
the
fix/studio-render-panic
branch
from
September 22, 2026 08:35
70fc5c6 to
378aaef
Compare
LeadcodeDev
force-pushed
the
fix/studio-stale-write
branch
from
September 22, 2026 08:45
64683cc to
85f344b
Compare
render_frame panics on failure (.expect("render frame"), .expect("rgba
matches dimensions"), .expect("encode jpeg")). Because the panic happens in
the scoped child thread and is consumed by join().unwrap_or_default(), the
catch_unwind wrapper in view.rs::serve_or_render never fires — so
fail_ledger().record_failure(key) is unreachable on that path and the whole
retry-budget mechanism is dead code for the on-demand asset handler. Instead
the empty Vec is treated as a successful render: frame_cache().insert(key,
rendered.clone(), ...) caches zero bytes, and the responder replies 200
image/jpeg with an empty body. The canvas shows a permanently broken image
for that (generation, frame, scale) and the cache guarantees it is never re-
attempted. (The prefetch worker path calls render_frame directly and is
correctly fenced.)
Fix: Return Result from render_frame_deep (propagate join()'s Err instead of
unwrap_or_default), or at minimum refuse to cache/serve an empty byte vector
and record it in the fail ledger so serve_or_render returns 500 and the
webview keeps the previous frame.
Refs #220
LeadcodeDev
force-pushed
the
fix/studio-render-panic
branch
from
September 22, 2026 08:45
378aaef to
d85631b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Severity Low, category correctness. Location:
crates/rustmotion-studio/src/editor/frames.rs:42Impact
render_framepanics on failure (.expect("render frame"),.expect("rgba matches dimensions"),.expect("encode jpeg")). Because the panic happens in the scoped child thread and is consumed byjoin().unwrap_or_default(), thecatch_unwindwrapper inview.rs::serve_or_rendernever fires — sofail_ledger().record_failure(key)is unreachable on that path and the whole retry-budget mechanism is dead code for the on-demand asset handler. Instead the emptyVecis treated as a successful render:frame_cache().insert(key, rendered.clone(), ...)caches zero bytes, and the responder replies200 image/jpegwith an empty body. The canvas shows a permanently broken image for that (generation, frame, scale) and the cache guarantees it is never re-attempted. (The prefetch worker path callsrender_framedirectly and is correctly fenced.)Fix
Return
Resultfromrender_frame_deep(propagatejoin()'sErrinstead ofunwrap_or_default), or at minimum refuse to cache/serve an empty byte vector and record it in the fail ledger soserve_or_renderreturns 500 and the webview keeps the previous frame.Evidence the audit read
Part of the September 2026 audit remediation chantier. Refs #220 (RM-28).