Context
Found by @neo-opus-grace reviewing PR #18127, which added a second caller of startViewTransition(). She flagged the awaited round trip as a new failure surface; it turned out to be a property of the pattern, present in the Portal since the reveal shipped. #18127 guards its own caller and deliberately did not widen into this one.
Live latest-open sweep: checked the latest 12 open issues at 2026-09-02T17:10Z; no equivalent found. Confirmed at the source rather than assumed: ViewportController.mjs:285-291 has no .catch() on the await.
The Problem
Portal.view.ViewportController#onSwitchTheme awaits a remote method and then applies the theme:
await Neo.main.DomAccess.startViewTransition({...});
me.setTheme(newTheme)The engine method itself is well behaved — it returns false without the View Transition API, and catches a rejected ready or a throwing registration internally, so it resolves rather than rejects. But Neo.main.DomAccess.startViewTransition called from the App worker is a proxy: it posts a message and returns a promise created worker-side. If that round trip rejects — for any reason the main-thread method never observes — the await throws, setTheme is never reached, and the theme button silently does nothing.
That is strictly worse than the outcome the call exists to improve. The reveal is decorative; losing it should cost an animation, not the feature.
The Architectural Reality
The guard cannot live in the engine, and I checked before proposing it there. DomAccess.startViewTransition runs on the main thread and cannot see a transport failure of the promise the worker is holding — by the time the transport fails there is nothing for the callee to catch. Absorbing it in the remote-method bridge would silently swallow rejections for every remote call, which is far too broad. So the guard belongs at each caller that treats the result as decorative.
| caller |
file:line |
state |
| Workstation |
apps/workstation/view/Workspace.mjs |
guarded in PR #18127, with a red-first arm |
| Portal |
apps/portal/view/ViewportController.mjs:285 |
unguarded — this ticket |
The Fix
Append .catch(() => {}) to the awaited call in onSwitchTheme, and state in a comment why a decorative call must not be able to take the theme change down with it. Mirror #18127's unit arm: a stub that rejects, asserting the theme still flips and nothing throws — the arm must fail without the guard.
Acceptance Criteria
Out of Scope
- Any change to
DomAccess or the remote-method bridge. Explained above: the callee cannot see this, and a bridge-level catch would swallow rejections for every remote call in the framework.
- Auditing every other awaited remote call for the same shape. Worth doing as its own sweep with its own evidence; bundling it here would turn a two-line fix into an open-ended audit.
Avoided Traps
- Pushing the guard into the engine because two callers need it. The "N sites, one idiom" instinct is usually right and is wrong here — the engine is on the far side of the boundary that fails.
- Fixing this inside PR #18127. The Portal's defect is true whether or not that PR exists, so it is not required for it; folding it in would have made an approved diff grow past its stated scope.
Related
- PR #18127 / #18125 — the Workstation caller, guarded, where this was found.
- #17739 / PR #17743 — the engine contract that documents what
startViewTransition can and cannot observe.
Origin Session ID: 7596538d-5324-419a-b043-95c585d833ea
Retrieval Hint: startViewTransition remote method proxy transport rejection decorative caller catch portal onSwitchTheme
Context
Found by @neo-opus-grace reviewing PR #18127, which added a second caller of
startViewTransition(). She flagged the awaited round trip as a new failure surface; it turned out to be a property of the pattern, present in the Portal since the reveal shipped. #18127 guards its own caller and deliberately did not widen into this one.Live latest-open sweep: checked the latest 12 open issues at 2026-09-02T17:10Z; no equivalent found. Confirmed at the source rather than assumed:
ViewportController.mjs:285-291has no.catch()on the await.The Problem
Portal.view.ViewportController#onSwitchThemeawaits a remote method and then applies the theme:await Neo.main.DomAccess.startViewTransition({...}); me.setTheme(newTheme)The engine method itself is well behaved — it returns
falsewithout the View Transition API, and catches a rejectedreadyor a throwing registration internally, so it resolves rather than rejects. ButNeo.main.DomAccess.startViewTransitioncalled from the App worker is a proxy: it posts a message and returns a promise created worker-side. If that round trip rejects — for any reason the main-thread method never observes — theawaitthrows,setThemeis never reached, and the theme button silently does nothing.That is strictly worse than the outcome the call exists to improve. The reveal is decorative; losing it should cost an animation, not the feature.
The Architectural Reality
The guard cannot live in the engine, and I checked before proposing it there.
DomAccess.startViewTransitionruns on the main thread and cannot see a transport failure of the promise the worker is holding — by the time the transport fails there is nothing for the callee to catch. Absorbing it in the remote-method bridge would silently swallow rejections for every remote call, which is far too broad. So the guard belongs at each caller that treats the result as decorative.apps/workstation/view/Workspace.mjsapps/portal/view/ViewportController.mjs:285The Fix
Append
.catch(() => {})to the awaited call inonSwitchTheme, and state in a comment why a decorative call must not be able to take the theme change down with it. Mirror #18127's unit arm: a stub that rejects, asserting the theme still flips and nothing throws — the arm must fail without the guard.Acceptance Criteria
startViewTransitionround trip still applies the Portal's theme switch, with no throw.delaywindow.Out of Scope
DomAccessor the remote-method bridge. Explained above: the callee cannot see this, and a bridge-level catch would swallow rejections for every remote call in the framework.Avoided Traps
Related
startViewTransitioncan and cannot observe.Origin Session ID: 7596538d-5324-419a-b043-95c585d833ea
Retrieval Hint:
startViewTransition remote method proxy transport rejection decorative caller catch portal onSwitchTheme