Skip to content

Slideshow lint accepts quoted time bounds that seek past the slide #6513

Closed

Description

@AksharP5

Describe the bug

A slideshow JSON island with "startTime": "1" and "endTime": 5 passes lint with zero findings. The manifest parser returns the quoted value as if it were a number, and the slideshow controller seeks to the string "12" instead of the numeric midpoint 3. That seek is beyond the five-second slide.

isSlideRef checks the scene ID, fragments, hotspots and autoplay flag, but never checks the types of startTime or endTime. The same gap exists for branch slides. Nonnumeric values and overflowing JSON numbers can reach numeric timeline operations.

Minimal reproduction

In a repository checkout at be036160fe6c2522ba20c9a0f86c1afba7e8a648, run bun install --frozen-lockfile and bun run build. Save this as repro.ts at the repository root:

import { parseSlideshowManifest, resolveSlideshow } from './packages/parsers/src/slideshow/index.ts';
import { lintHyperframeHtml } from './packages/lint/src/hyperframeLinter.ts';
import { SlideshowController } from './packages/player/src/slideshow/SlideshowController.ts';

for (const startTime of [1, '1']) {
  const html = `<html><body>
<div id="stage" data-composition-id="deck" data-start="0" data-duration="5" data-width="1920" data-height="1080">
  <div id="content" class="clip" data-start="0" data-duration="5" data-track-index="0">Hello</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js"></script>
<script>window.__timelines = { deck: gsap.timeline({ paused: true }) };</script>
<script type="application/hyperframes-slideshow+json">${JSON.stringify({ slides: [{ sceneId: 'intro', startTime, endTime: 5 }] })}</script>
</body></html>`;
  const lint = await lintHyperframeHtml(html);
  console.log({ startTime, ok: lint.ok, findings: lint.findings.map(f => f.code) });
  try {
    const manifest = parseSlideshowManifest(html);
    if (!manifest) throw new Error('Missing manifest');
    const { resolved, errors } = resolveSlideshow(manifest, []);
    console.log({ errors });
    new SlideshowController({
      currentTime: 0,
      seek(time) { console.log({ seek: time, type: typeof time }); },
      play() {},
      pause() {},
      onTimeUpdate() { return () => {}; },
    }, resolved);
  } catch (error) {
    console.log(error instanceof Error ? error.message : String(error));
  }
}

The fixture has no private media and needs no external request. The GSAP script tag is only inspected by the static linter. The port records the real slideshow controller's requested seek.

Steps to reproduce

Run bun repro.ts. Compare the numeric 1 control with the quoted "1" input.

Expected behavior

Reject the malformed timing at the manifest boundary and return the existing slideshow_invalid lint error. Numeric time bounds, including zero and omitted optional bounds, remain supported.

Actual behavior

startTime, same endTime: 5 Lint Controller seek
1 ok: true, no findings 3, number
"1" ok: true, no findings "12", string

Both inputs also return no resolution errors.

Environment

  • Upstream main be036160fe6c2522ba20c9a0f86c1afba7e8a648
  • Linux aarch64, Node.js 24.22.1, Bun 1.4.4
  • Workspace dependencies installed from the lockfile; full workspace build completed
  • No browser, renderer, or private media required for this parser/linter/controller reproduction

Additional context

Related merged work #1585 and #1594 validates manifest structure and numeric range ordering. #5211 validates nested hotspots. None checks the start/end value types demonstrated here. This is a parser boundary correction; player behavior and timing defaults do not need to change.

Activity

  1. added
    bug
    triage/ready
    on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriage/ready

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions