From b5c6b8a0735d1cd022cc16d58b63e26140f5a528 Mon Sep 17 00:00:00 2001 From: anti Date: Fri, 24 Apr 2026 10:25:42 -0400 Subject: [PATCH] fix(web/session): preload cast so parse runs at mount, not click Without preload:true the player only parses the recording when the user first clicks play. Any parse error during that lazy step bypasses our lifecycle instrumentation (we only see "ready", which just means UI mounted), and from the user's POV the play button stays black because they never see the actual failure. Forcing preload makes the driver's init() run synchronously-ish with the "ready" dispatch, so getDuration() resolves to a real number (or we see an "errored" event with a payload that tells us why). --- decnet_web/src/components/SessionDrawer.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/decnet_web/src/components/SessionDrawer.tsx b/decnet_web/src/components/SessionDrawer.tsx index e7bdfe5e..1d0bf568 100644 --- a/decnet_web/src/components/SessionDrawer.tsx +++ b/decnet_web/src/components/SessionDrawer.tsx @@ -148,7 +148,14 @@ const SessionDrawer: React.FC = ({ decky, sid, fields, onClo const p = AsciinemaPlayer.create( { data: cast }, playerContainer.current, - { fit: 'width', terminalFontSize: '12px' }, + { + fit: 'width', + terminalFontSize: '12px', + // Force parse up front. Without this the recording is only + // parsed on the user's click-to-play, and any parse failure + // there is invisible to our lifecycle instrumentation above. + preload: true, + }, ); playerInstance.current = p; // The player's init() is async; any failure there bypasses the