[GH-ISSUE #3673] [GUI] Firefox: route-change view transition deadlocks ~5s (update callback waits on rAF the pending transition holds) #1520

Closed
opened 2026-11-04 01:51:55 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @MatthewHines on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3673

Problem: Any route change in the App Host UI (sidebar engine chip, New conversation) makes the page swallow all clicks for ~4-5 s in Firefox, then it recovers by itself. The page is not frozen; a reload is not needed.

Environment: Strata image 0.2.0-beta-nvfp4.3.1 (strata-nvfp4 fork build; apps/host/src/lib/router.ts identical to upstream), Firefox 158.0.1, Fedora Linux, RTX 5090 32 GB, model qwen3.8-flash-next NVFP4, App Host via Caddy on LAN.

Reproduce: Firefox, open the App Host UI, click the engine chip at the sidebar foot (or New conversation). Expected: view crossfades to the target route immediately. Actual: no click anywhere registers for ~4-5 s; CSS animations keep pulsing; the Monitor view's 5 s auto-refresh shows no update until the stall passes; then everything works again. Deterministic on every attempt.

Mechanism: navigateHash() starts a same-document document.startViewTransition() whose update callback flips the hash synchronously, then resolves after two requestAnimationFrame()s:

const transition = document.startViewTransition(
  () => new Promise(done => {
    window.location.hash = next;
    requestAnimationFrame(() => requestAnimationFrame(() => done()));
  }),
);

While a pending view transition waits on its update callback, the browser holds the rendering pipeline - and rAF callbacks are rendering-driven. On Firefox this deadlocks until an internal update-pending guard (observed ~4-5 s) forces it through. That single deadlock explains every symptom: the hash already equals the target, so if (window.location.hash === next) return; early-returns on every further navigation click; non-nav clicks land on a paint-held document; timer-driven DOM updates (Monitor refresh) are deferred; and the main thread is idle throughout, so the DevTools console is instant.

Evidence (collected live during stalls, Firefox DevTools):

  • performance.getEntriesByType('resource') right after recovery: no entry > 300 ms (nothing network-bound).
  • No long tasks anywhere; console evaluation instant (main thread idle).
  • DOM probe (elementFromPoint, computed pointer-events, [inert]) identical frozen vs. healthy - no input interceptor.
  • Stall is consistent 4-5 s on every click; setting document.documentElement.dataset.motion = 'reduced' (which takes the existing non-morph path in navigateHash) removes it immediately.
  • Chromium never reproduces it, and hidden/background tabs skip view transitions entirely, so headless UI tests structurally cannot catch this.

Note: isWebKitGtk() exists because WebKitGTK crashes on startViewTransition - same API, same engine-quirk category, different failure mode. Firefox's implementation doesn't crash; it starves the callback.

Proposed fix (either suffices):

  1. Race the frame wait against a deadline, one line:
() => new Promise(done => {
  window.location.hash = next;
  requestAnimationFrame(() => requestAnimationFrame(done));
  setTimeout(done, 250); // safety rail: rAF can be held by the transition itself
})

(Double resolution is a no-op; unaffected engines behave exactly as before. We have shipped this local edit over the built bundle and the stall is gone in Firefox 158.)

  1. Or gate Firefox the way WebKitGTK is gated, though that drops the crossfade for all Firefox users.

Reproduction status: reproduced locally (two users, every attempt, workaround and fix both verified).

Originally created by @MatthewHines on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3673 Problem: Any route change in the App Host UI (sidebar engine chip, New conversation) makes the page swallow **all clicks for ~4-5 s** in Firefox, then it recovers by itself. The page is not frozen; a reload is not needed. Environment: Strata image `0.2.0-beta-nvfp4.3.1` (strata-nvfp4 fork build; `apps/host/src/lib/router.ts` identical to upstream), Firefox 158.0.1, Fedora Linux, RTX 5090 32 GB, model qwen3.8-flash-next NVFP4, App Host via Caddy on LAN. Reproduce: Firefox, open the App Host UI, click the engine chip at the sidebar foot (or New conversation). Expected: view crossfades to the target route immediately. Actual: no click anywhere registers for ~4-5 s; CSS animations keep pulsing; the Monitor view's 5 s auto-refresh shows no update until the stall passes; then everything works again. Deterministic on every attempt. Mechanism: `navigateHash()` starts a same-document `document.startViewTransition()` whose update callback flips the hash synchronously, then resolves after **two `requestAnimationFrame()`s**: ```ts const transition = document.startViewTransition( () => new Promise(done => { window.location.hash = next; requestAnimationFrame(() => requestAnimationFrame(() => done())); }), ); ``` While a pending view transition waits on its update callback, the browser holds the rendering pipeline - and rAF callbacks are rendering-driven. On Firefox this deadlocks until an internal update-pending guard (observed ~4-5 s) forces it through. That single deadlock explains every symptom: the hash already equals the target, so `if (window.location.hash === next) return;` early-returns on every further navigation click; non-nav clicks land on a paint-held document; timer-driven DOM updates (Monitor refresh) are deferred; and the main thread is idle throughout, so the DevTools console is instant. Evidence (collected live during stalls, Firefox DevTools): - `performance.getEntriesByType('resource')` right after recovery: no entry > 300 ms (nothing network-bound). - No long tasks anywhere; console evaluation instant (main thread idle). - DOM probe (`elementFromPoint`, computed `pointer-events`, `[inert]`) identical frozen vs. healthy - no input interceptor. - Stall is consistent 4-5 s on every click; setting `document.documentElement.dataset.motion = 'reduced'` (which takes the existing non-morph path in `navigateHash`) removes it immediately. - Chromium never reproduces it, and hidden/background tabs skip view transitions entirely, so headless UI tests structurally cannot catch this. Note: `isWebKitGtk()` exists because WebKitGTK *crashes* on `startViewTransition` - same API, same engine-quirk category, different failure mode. Firefox's implementation doesn't crash; it starves the callback. Proposed fix (either suffices): 1. Race the frame wait against a deadline, one line: ```ts () => new Promise(done => { window.location.hash = next; requestAnimationFrame(() => requestAnimationFrame(done)); setTimeout(done, 250); // safety rail: rAF can be held by the transition itself }) ``` (Double resolution is a no-op; unaffected engines behave exactly as before. We have shipped this local edit over the built bundle and the stall is gone in Firefox 158.) 2. Or gate Firefox the way WebKitGTK is gated, though that drops the crossfade for all Firefox users. Reproduction status: reproduced locally (two users, every attempt, workaround and fix both verified).
Author
Owner

@github-actions[bot] commented on GitHub (Oct 22, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6331425291 --> @github-actions[bot] commented on GitHub (Oct 22, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 22, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6331617468 --> @github-actions[bot] commented on GitHub (Oct 22, 2026): Thanks, this follows the format now.
Author
Owner

@Niko1221 commented on GitHub (Oct 24, 2026):

This is fixed in Strata 0.2.3. Please update to the latest release (in the Terminal: strata update; in the app: download the newest installer from the releases page). If it still happens on the latest version, reply here and we will reopen it. Thank you for the report.

<!-- gh-comment-id:6383447418 --> @Niko1221 commented on GitHub (Oct 24, 2026): This is fixed in Strata 0.2.3. Please update to the latest release (in the Terminal: `strata update`; in the app: download the newest installer from the releases page). If it still happens on the latest version, reply here and we will reopen it. Thank you for the report.
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
Niko1221/Strata#1520
No description provided.