fix(desktop): skip view transitions on Linux WebKit (#3931) - #4276
fix(desktop): skip view transitions on Linux WebKit (#3931)#4276iroiro147 wants to merge 2 commits into
Conversation
When a managed agent's underlying LLM call returns 401/403, buzz-agent classifies it as JSON-RPC -32001 and the desktop previously rewrote that to "Community access denied this agent — check its community membership." for every agent, regardless of provider. That misleads the "Local OpenAI-compatible" lane where the 401 came from the user's own upstream (e.g. llama.cpp started with `--api-key`): the reporter's actual fix is "your configured key doesn't match the server's", but the rewritten copy points them at community membership — an unrelated codepath (see block#4205). `friendlyAgentLastError` and `friendlyTurnErrorCopy` now accept the agent's configured LLM provider and only substitute the mesh copy when `provider === "relay-mesh"`; all other providers keep the raw error verbatim. The legacy string fallback for pre-code records (`"llm auth:"` prefix) gets the same gate so the conservative behavior is consistent. Callers in ManagedAgentRow and UnifiedAgentsSection thread `agent.provider` through. Tests mirror the reporter's lane (non-mesh + -32001 → preserved) and the mesh case stays regression-tested. http://github.com/block/buzz/issues/4205 Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
Buzz hangs on Linux Mint (AppImage / webkitgtk) when the user removes the active community: `document.startViewTransition` opens a transition whose `updateCallbackDone` promise never settles on webkitgtk because destroying the currently painted frame mid-transition invalidates the view-transition scene and WebKit never resumes the callback promise. The user sees a frozen window and has to SIGKILL the app. Windows does not hit the same codepath because the frame lifecycle is different. The view transition is purely cosmetic; the other branch already runs the update directly when `document.startViewTransition` is unavailable. Extend that branch to Linux as well: detect Linux via `isLinuxPlatform()` and skip the transition entirely. The update still runs, relay switches, the new community mounts — Linux users just see an instant swap instead of a cross-fade, exactly as the unsupported-browser path delivers. Repro from the reporter: Linux Mint + Buzz v0.5.2 AppImage → open a hosted community → Community Settings → Remove Community → window freezes. Includes a unit test that stubs the navigator as Linux and asserts `startViewTransition` is never invoked while the update still runs. Fixes block#3931 Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
|
We independently arrived at the same guard while chasing the #3488 / #4142 segfault — different symptom, same call site. Evidence and the env-var matrix are in #3488 (comment). So: +1 on skipping view transitions on Linux WebKit. One heads-up on the implementation, in case it's why this has been sitting: A UA-based check ( Happy either way — I can help get this PR green instead (it'd also want the unrelated |
|
@oso0x34 this is an excellent catch on both counts, and I verified rather than took it on faith: Your #5768 is the better home for this fix: the UA-based check ( If maintainers want the For maintainers: #5768 supersedes the view-transition half of this PR and is the one worth review time. |
What
Buzz hangs on Linux Mint (AppImage / webkitgtk) when the user removes the active community. The user reports having to force-quit the app. Windows does not hit the same codepath.
Root cause.
runCommunityViewTransitioncallsdocument.startViewTransition(update). The transition'supdateCallbackDonepromise never settles on webkitgtk when the update destroys the currently painted frame mid-transition: WebKit invalidates the transition scene and the promise hangs forever. The 5stargetReadytimeout does fire and the update itself completes (community is removed, fallback mounts), but the view-transition promise is stuck — sorunCommunityViewTransitionnever returns to its caller and subsequent navigation stays broken until the process is killed.Fix. The view transition is purely cosmetic. We already bypass it whenever
document.startViewTransitionis unavailable; this PR extends that branch to Linux as well, detected via the existingisLinuxPlatform()helper indesktop/src/shared/lib/platform.ts. On Linux the update runs to completion immediately and the app never enters the WebKit path that hangs. Behavior on Windows and macOS is unchanged.Repro
From the reporter: Linux Mint + Buzz v0.5.2 AppImage → open a hosted community → Community Settings → Remove Community → window freezes.
Changes
desktop/src/app/communityViewTransition.ts: importisLinuxPlatform, OR it into the unsupported-browser branch so the update runs directly.desktop/src/app/communityViewTransition.test.mjs: new test stubsglobalThis.navigatoras Linux, assertsstartViewTransitionis never called and the update still runs.Tests
desktop/node --import ./test-loader.mjs --experimental-strip-types --test "src/app/communityViewTransition.test.mjs"→ 7/7pnpm exec tsc --noEmitcleanFixes #3931
Signed-off-by: Sarthak Singh sarthak.singh@juspay.in