Files
romm/backend/handler
Georges-Antoine Assi 95a71a6539 fix(streaming): drain the stashed frame and ask the broker once
Apply the code-review pass over the screenshot preference order.

take_state_frame() was the only consumer that deletes the Redis key, so
once an emulator's own frame won, a stashed browser frame survived its
save and could become a later one's thumbnail. Drain it on every pull.
For RetroArch the unguarded final fallback re-issued the identical
/state-screenshot GET, a second blocking 60s request held while the
container reservation is still out. The retroarch literal moves to a
module-level _BROKER_FRAME_EMULATORS, next to the other per-emulator
tables, and extract_state_screenshot() catches anything the zip read
raises so a corrupt embedded PNG costs the thumbnail, not the state.

Tests cover the RetroArch broker preference, its fallback to the browser
frame, and the single broker request when neither source exists.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-12 20:33:14 -04:00
..
2025-12-07 12:19:13 -05:00