[PR #7904] [MERGED] fix(e2e): play Linux WebKit audio to a fake sink so the Tracker bubble tap cannot freeze the page #8000

Closed
opened 2026-10-24 04:09:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7904
Author: @SpicyMarinara
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/webkit-tracker-click-stall


📝 Commits (2)

  • bd34979 fix(e2e): play WebKit audio to a fake sink so the first tap cannot freeze the page
  • a5ee522 Merge branch 'staging' into fix/webkit-tracker-click-stall

📊 Changes

2 files changed (+18 additions, -0 deletions)

View changed files

📝 playwright.config.ts (+12 -0)
📝 scripts/regressions/open-issues.regression.ts (+6 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

No issue. This fixes a release-matrix stall from run 39457323028 (mobile-webkit shard 18, job 118747547482), which is blocking the 2.5.1 release. @SpicyMarinara

Why this change

  • In run 39457323028, tracker-window.e2e.ts:95 hung on mobile-webkit while tapping the Tracker bubble. No assertion after the tap ran, and the 60 s deadline's finally DELETE then hid the original wait.
  • The CI trace shows the tap reaching "performing click action" and never "click action done". After it there are no requests, console messages or screencast frames for about 52 s. In the video, the accent ring never changes from the tap to the end of the recording. It is driven by a 500 ms timer through an 18 s red, green and blue cycle, and the passing run asserts that it changes. So the page's main thread froze at the tap; nothing was covering the bubble and nothing moved it.
  • Cause: this tap is the page's first gesture, and game-audio.ts unlock() runs on it. It plays a silent <audio> and starts an AudioContext. WebKit on Linux plays through GStreamer, which opens the audio device on the page's main thread for both. When the runner's audio stack hangs, the page freezes at that tap. Chromium already gets --disable-audio-output for this class of stall; WebKit had nothing.
  • Related: the same job also froze inside TTS media teardown (tts-mobile-playback.e2e.ts), another GStreamer operation on the main thread. That spec got its own fix in 2dfa25075. This change also keeps that spec's audio off a real device, but I have not re-proven that case.

What changed

  • playwright.config.ts: rank GStreamer's fakeaudiosink first (GST_PLUGIN_FEATURE_RANK=fakeaudiosink:MAX) in the runner's environment. Every browser the runner starts inherits it, including a spec's own WebKit launch options (avatar-voice-sync.e2e.ts overrides them with {}). WebKit then never opens an audio device, while playback keeps its real clock and events. Chromium and WebKit on macOS ignore the variable. The value is appended only once, because workers load the config again.
  • scripts/regressions/open-issues.regression.ts: pin it beside the existing Chromium --disable-audio-output assertion.

No app code, spec, assertion or timeout changes.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Agent-run results (please verify; boxes intentionally left unchecked):

  • pnpm check: passed on the rebased branch.
  • Open-issues regression: fails on staging's config (AssertionError: WebKit e2e browsers play to GStreamer's fake audio sink) and passes with this change.
  • Reproduction on Linux WebKit (Playwright 1.63 official noble image, run-server, real app and the exact tracker-window flow; the audio server accepts connections and never answers, i.e. a hung audio stack):
    • Before: 3/3 first taps froze the page for more than 60 s. The click never returned, or it returned and the panel never rendered, and page.evaluate got no answer within 30 s. The audio server got 7 connections.
    • After: 20/20 taps completed, with 0 audio-server connections.
    • Minimal page with only the unlock: before, both new Audio().play() and new AudioContext() hung the tap 4/4 and evaluate hung too (control without audio: 0/2). After: 0/6 (control: 0/3).
  • No-stall A/B on Linux WebKit (20 rounds each, run at the same time): plain and fake sink both completed 20/20 taps. Each had 2/20 renderer crashes ("Target crashed") right after the tap, so those crashes are unrelated to this change; see notes.
  • Local macOS, tracker-window.e2e.ts --repeat-each=20 --workers=2:
    • mobile-webkit 40/40 passed.
    • mobile-chromium 40/40 passed on a clean rerun. The first pass had 2 failures caused by my own parallel server boot rebuilding packages/shared under the running Vite server; the page reloaded mid-test.
  • CI before: 1 hang in run 39457323028 (mobile-webkit 18/18).

Manual verification notes

  • Manually verify the next full staging matrix (playwright.yml, mobile-webkit 18 shards) shows no WebKit stall at a first tap.
  • Manually verify on a Linux machine that a local WebKit e2e run makes no sound, and that the TTS and avatar voice specs still see their playback events.
  • Observation outside this fix: in local arm64 Docker under very heavy load (load average about 50), WebKit's renderer crashed right after the tap in 5 of 60 rounds, with or without this change. This test's CI history shows no such crash, but it may deserve its own issue if it ever appears in the matrix.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Test-environment change only; no docs or release files touched.

UI evidence (if applicable)

Not applicable (no UI change).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7904 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/webkit-tracker-click-stall` --- ### 📝 Commits (2) - [`bd34979`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bd349798b798ce81af9855d0542ca5301e6df8b8) fix(e2e): play WebKit audio to a fake sink so the first tap cannot freeze the page - [`a5ee522`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a5ee522573697959da9c6901599e9cdf83219158) Merge branch 'staging' into fix/webkit-tracker-click-stall ### 📊 Changes **2 files changed** (+18 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `playwright.config.ts` (+12 -0) 📝 `scripts/regressions/open-issues.regression.ts` (+6 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue No issue. This fixes a release-matrix stall from run 39457323028 (mobile-webkit shard 18, job 118747547482), which is blocking the 2.5.1 release. @SpicyMarinara ## Why this change - In run 39457323028, `tracker-window.e2e.ts:95` hung on mobile-webkit while tapping the Tracker bubble. No assertion after the tap ran, and the 60 s deadline's `finally` DELETE then hid the original wait. - The CI trace shows the tap reaching "performing click action" and never "click action done". After it there are no requests, console messages or screencast frames for about 52 s. In the video, the accent ring never changes from the tap to the end of the recording. It is driven by a 500 ms timer through an 18 s red, green and blue cycle, and the passing run asserts that it changes. So the page's main thread froze at the tap; nothing was covering the bubble and nothing moved it. - **Cause:** this tap is the page's first gesture, and `game-audio.ts` `unlock()` runs on it. It plays a silent `<audio>` and starts an `AudioContext`. WebKit on Linux plays through GStreamer, which opens the audio device on the page's main thread for both. When the runner's audio stack hangs, the page freezes at that tap. Chromium already gets `--disable-audio-output` for this class of stall; WebKit had nothing. - Related: the same job also froze inside TTS media teardown (`tts-mobile-playback.e2e.ts`), another GStreamer operation on the main thread. That spec got its own fix in 2dfa25075. This change also keeps that spec's audio off a real device, but I have not re-proven that case. ## What changed - `playwright.config.ts`: rank GStreamer's `fakeaudiosink` first (`GST_PLUGIN_FEATURE_RANK=fakeaudiosink:MAX`) in the runner's environment. Every browser the runner starts inherits it, including a spec's own WebKit launch options (`avatar-voice-sync.e2e.ts` overrides them with `{}`). WebKit then never opens an audio device, while playback keeps its real clock and events. Chromium and WebKit on macOS ignore the variable. The value is appended only once, because workers load the config again. - `scripts/regressions/open-issues.regression.ts`: pin it beside the existing Chromium `--disable-audio-output` assertion. No app code, spec, assertion or timeout changes. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Agent-run results (please verify; boxes intentionally left unchecked): - `pnpm check`: passed on the rebased branch. - Open-issues regression: fails on staging's config (`AssertionError: WebKit e2e browsers play to GStreamer's fake audio sink`) and passes with this change. - **Reproduction on Linux WebKit** (Playwright 1.63 official `noble` image, run-server, real app and the exact tracker-window flow; the audio server accepts connections and never answers, i.e. a hung audio stack): - Before: **3/3** first taps froze the page for more than 60 s. The click never returned, or it returned and the panel never rendered, and `page.evaluate` got no answer within 30 s. The audio server got 7 connections. - After: **20/20** taps completed, with **0** audio-server connections. - Minimal page with only the unlock: before, both `new Audio().play()` and `new AudioContext()` hung the tap 4/4 and `evaluate` hung too (control without audio: 0/2). After: 0/6 (control: 0/3). - **No-stall A/B on Linux WebKit** (20 rounds each, run at the same time): plain and fake sink both completed 20/20 taps. Each had 2/20 renderer crashes ("Target crashed") right after the tap, so those crashes are unrelated to this change; see notes. - Local macOS, `tracker-window.e2e.ts --repeat-each=20 --workers=2`: - mobile-webkit **40/40** passed. - mobile-chromium **40/40** passed on a clean rerun. The first pass had 2 failures caused by my own parallel server boot rebuilding `packages/shared` under the running Vite server; the page reloaded mid-test. - CI before: 1 hang in run 39457323028 (mobile-webkit 18/18). ### Manual verification notes - Manually verify the next full staging matrix (`playwright.yml`, mobile-webkit 18 shards) shows no WebKit stall at a first tap. - Manually verify on a Linux machine that a local WebKit e2e run makes no sound, and that the TTS and avatar voice specs still see their playback events. - Observation outside this fix: in local arm64 Docker under very heavy load (load average about 50), WebKit's renderer crashed right after the tap in 5 of 60 rounds, with or without this change. This test's CI history shows no such crash, but it may deserve its own issue if it ever appears in the matrix. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Test-environment change only; no docs or release files touched. ## UI evidence (if applicable) Not applicable (no UI change). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:09:32 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8000
No description provided.