From 581804bb96715eea957f0bf337ed78ab163fe1b9 Mon Sep 17 00:00:00 2001 From: superset-home <338338640+superset-home@users.noreply.github.com> Date: Wed, 11 Nov 2026 06:58:39 +0000 Subject: [PATCH] fix(desktop): give the stored cloud chat a workspace tRPC context while its box wakes The stored-chat screen renders the chat pane's transcript before the box has an address, outside WorkspaceProvider. Image attachments, attachment parts and changed-files cards call workspaceTrpc hooks, which throw without a provider even when the query is disabled, so the dashboard content boundary showed its error page until the user navigated away. Mount a workspaceTrpc provider whose client fails every call. With no ChatPaneActions workspaceId the host queries stay disabled and the rows fall back to file cards, as they were written to. Refs DESKTOP-1V4 --- .../StoredCloudChat/StoredCloudChat.tsx | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/StoredCloudChat/StoredCloudChat.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/StoredCloudChat/StoredCloudChat.tsx index fe94808db9b..35cb6694a46 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/StoredCloudChat/StoredCloudChat.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/StoredCloudChat/StoredCloudChat.tsx @@ -1,9 +1,14 @@ import { useLingui } from "@lingui/react/macro"; +import type { AppRouter } from "@superset/host-service/trpc"; +import { workspaceTrpc } from "@superset/workspace-client"; import { keepPreviousData, + QueryClient, useQuery, useQueryClient, } from "@tanstack/react-query"; +import { TRPCClientError } from "@trpc/client"; +import { observable } from "@trpc/server/observable"; import { type ReactNode, useEffect } from "react"; import { cloudTrpc } from "renderer/lib/cloud-trpc"; import { electronQueryClient } from "renderer/providers/ElectronTRPCProvider"; @@ -23,6 +28,21 @@ const PREFETCHED_CHATS = 5; const STALE_MS = 60_000; const NO_PROMPTS: never[] = []; +/** Transcript rows call workspace hooks, which need a client even with no box to reach. */ +const noHostClient = workspaceTrpc.createClient({ + links: [ + () => () => + observable((observer) => + observer.error( + new TRPCClientError("The workspace has no host yet"), + ), + ), + ], +}); +const noHostQueryClient = new QueryClient({ + defaultOptions: { queries: { retry: false } }, +}); + /** * A cloud workspace's newest chat as the database holds it, while the * workspace waits for its box to answer, else `fallback`. It is cached under @@ -86,11 +106,16 @@ export function StoredCloudChat({ }) } /> - + + +
);