Skip to content

[Test logic] Metadata progress drift formula is never exercised #46

@balloob

Description

@balloob

Problem

The spec's "Calculating current track position" section provides an explicit drift formula using timestamp, progress.track_progress, and progress.playback_speed:

calculated_progress = progress.track_progress + (current_time - metadata.timestamp) * progress.playback_speed / 1000000

The metadata scenario (server-initiated-metadata) sends track_progress=12000, track_duration=180000, playback_speed=1000 and compares a static snapshot — equality pass/fail, no time advancement.

Proposed fix

Add a scenario that:

  1. Sends metadata at server time T with track_progress=12000, playback_speed=1500 (1.5x).
  2. Holds the connection open for ~500 ms.
  3. Requests the client report its computed current_track_progress_ms at disconnect time.
  4. Asserts it is within tolerance of 12000 + 500 * 1.5 = 12750.

Also cover playback_speed=0 (paused — calculated progress must equal track_progress unchanged) and verify min/max clamping around track_duration and zero.

Spec references

  • "Calculating current track position"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions