Skip to content

Fix initial audio timestamp playback and add opt-in Midscene tests - #2316

Open
quanru wants to merge 4 commits into
syntaxfm:mainfrom
quanru:test/midscene
Open

quanru wants to merge 4 commits into
syntaxfm:mainfrom
quanru:test/midscene

Conversation

@quanru

@quanru quanru commented Nov 5, 2026

Copy link
Copy Markdown

Problem

A fresh listener opening an audio link such as ?t=0:01:03 can start playback at zero when clicking the main episode Play button. Initialization preloads the episode and marks it LOADED (or PAUSED for saved progress), so the page button resumes playback instead of taking its timestamp-aware initial-play path.

Changes

  • Preserve INITIAL while preloading; explicit loads still use LOADED / PAUSED. Add initialization unit regressions.
  • Add two optional Midscene browser cases: sharing with a timestamp starts a fresh listener at that position; enabling then disabling the timestamp starts a fresh listener at zero.
  • Exercise real UI controls, clipboard, short-link redirects and a real seekable local WAV. Read the first native audio play event to verify position, media source and episode identity. No mocked media methods or injected player state.
  • Provision a disposable MySQL service and fixture episode for CI. Keep the existing Playwright suite unchanged.
  • Gate the workflow behind MIDSCENE_E2E_ENABLED=true; model and optional Cloudflare credentials are repository-owned. No model costs or new secrets are required upstream unless maintainers opt in. Reports are downloadable and can optionally be published to Cloudflare Pages with links in Actions Summary.

The product fix and test integration are separate commits for independent review. The lockfile expansion is from the three added browser-test dependencies.

Validation

Rebased onto upstream e7ab8d35 and verified revision 5c35b1facaaf10c05ce9a175249906648b529ce2:

  • Restoring the original player status expression makes the initialization regression fail (PAUSED instead of INITIAL); restoring the fix passes both initialization tests.
  • Earlier real-browser reproduction on unchanged player code: expected first playback at 63 seconds, observed 0 seconds.
  • Fresh fork CI: configuration/type checks, all 37 unit tests, full lint, production build, and both Midscene cases passed.
  • Interactive report. Browser cases run serially with case retry set to zero, using official OpenAI gpt-6.1-terra.

Scope

Related to #2302, but does not resolve that issue: its report concerns video, while these tests cover audio via the main episode Play button. YouTube playback, audio/video timeline mapping, returning-listener deep links, and starting directly from the bottom player need separate investigation. The bottom control also started at zero during earlier diagnosis and is not claimed fixed here.

The existing fork Playwright PR workflow requires a DATABASE_URL secret and previously failed because it was absent. This PR does not claim that every existing fork workflow passes; the new optional CI provisions its own disposable database.

@vercel

vercel Bot commented Nov 5, 2026

Copy link
Copy Markdown

@quanru is attempting to deploy a commit to the Syntax Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant