From 442413870db3f16d8356861a42a3526fceb876cb Mon Sep 17 00:00:00 2001 From: anti Date: Fri, 24 Apr 2026 10:28:28 -0400 Subject: [PATCH] fix(web/session): subscribe to metadata/playing/idle/errored/reset/seeked too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The original short subscribe list missed 'metadata' — which is the one that carries the parsed duration + theme + marker info AFTER _initializeDriver (the step that actually parses the cast). Without it we only saw 'ready' (= UI mounted, parse not yet run) and jumped to conclusions about the parser. Add the full lifecycle set so the next repro pins which step the player is actually getting stuck at. --- 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 1d0bf568..975898dc 100644 --- a/decnet_web/src/components/SessionDrawer.tsx +++ b/decnet_web/src/components/SessionDrawer.tsx @@ -162,7 +162,14 @@ const SessionDrawer: React.FC = ({ decky, sid, fields, onClo // sync try/catch above and lands as an unhandled rejection. // Hook every lifecycle event so we can see which state it // actually ends up in ("loading" / "ended" / "errored" / etc). - for (const evt of ['ready', 'play', 'pause', 'ended', 'error', 'errored', 'loading']) { + // metadata is the one that carries the parsed duration, fires + // AFTER _initializeDriver (which does the actual cast parse). + // playing / idle tell us whether the timer ever advanced. + const events_to_hook = [ + 'ready', 'metadata', 'play', 'playing', 'pause', 'idle', + 'ended', 'error', 'errored', 'loading', 'reset', 'seeked', + ]; + for (const evt of events_to_hook) { try { p.addEventListener?.(evt, (...args: unknown[]) => console.debug(`asciinema-player event: ${evt}`, ...args),