diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/components/WorkspaceHostOfflineState/WorkspaceHostOfflineState.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/components/WorkspaceHostOfflineState/WorkspaceHostOfflineState.tsx deleted file mode 100644 index 19a8faf60e2..00000000000 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/components/WorkspaceHostOfflineState/WorkspaceHostOfflineState.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { Button } from "@superset/ui/button"; -import { Link } from "@tanstack/react-router"; -import { ArrowRight, Monitor } from "lucide-react"; - -interface WorkspaceHostOfflineStateProps { - hostName: string; -} - -export function WorkspaceHostOfflineState({ - hostName, -}: WorkspaceHostOfflineStateProps) { - return ( -
-
-
-
-
-
- -
-

- Host is offline -

-

- This workspace lives on a device that isn't reachable right now. - Open Superset on that device to bring the workspace back online. -

-
- -
-
- - -
-
- ); -} diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/components/WorkspaceHostOfflineState/index.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/components/WorkspaceHostOfflineState/index.ts deleted file mode 100644 index b0e77016c34..00000000000 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/components/WorkspaceHostOfflineState/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { WorkspaceHostOfflineState } from "./WorkspaceHostOfflineState"; diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/hooks/useRemoteHostStatus/useRemoteHostStatus.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/hooks/useRemoteHostStatus/useRemoteHostStatus.ts index 1d06272648a..95541881d30 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/hooks/useRemoteHostStatus/useRemoteHostStatus.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/hooks/useRemoteHostStatus/useRemoteHostStatus.ts @@ -13,7 +13,6 @@ import semver from "semver"; export type RemoteHostStatus = | { status: "skip" } | { status: "loading" } - | { status: "offline"; hostName: string } | { status: "incompatible"; hostName: string; @@ -47,7 +46,6 @@ export function useRemoteHostStatus( ) .select(({ hosts }) => ({ name: hosts.name, - isOnline: hosts.isOnline, })), [collections, organizationId, filterMachineId], ); @@ -61,7 +59,7 @@ export function useRemoteHostStatus( const infoQuery = useQuery({ queryKey: ["remoteHostInfo", organizationId, hostId], queryFn: () => getHostServiceClientByUrl(hostUrl).host.info.query(), - enabled: workspace != null && !isLocal && hostRow?.isOnline === true, + enabled: workspace != null && !isLocal, staleTime: HOST_INFO_STALE_MS, retry: false, }); @@ -69,32 +67,17 @@ export function useRemoteHostStatus( if (!workspace) return { status: "loading" }; if (isLocal) return { status: "skip" }; if (!isReady) return { status: "loading" }; - // No matching v2Hosts row once the collection is ready — host was - // deregistered while the workspace record stuck around. Surface the - // offline screen so users have a recovery path instead of a blank div. - if (!hostRow) return { status: "offline", hostName: "Unknown host" }; - if (!hostRow.isOnline) { - return { status: "offline", hostName: hostRow.name }; - } - - if (infoQuery.isPending) return { status: "loading" }; - - if (infoQuery.isError) { - // Cloud reports the host online but the relay round-trip failed — - // treat as offline; the most common cause is a stale `isOnline` - // flag after the host crashed without a clean disconnect. - return { status: "offline", hostName: hostRow.name }; - } - - const hostVersion = infoQuery.data.version; - if (!semver.satisfies(hostVersion, `>=${MIN_HOST_SERVICE_VERSION}`)) { - return { - status: "incompatible", - hostName: hostRow.name, - hostVersion, - minVersion: MIN_HOST_SERVICE_VERSION, - }; + if (infoQuery.isSuccess) { + const hostVersion = infoQuery.data.version; + if (!semver.satisfies(hostVersion, `>=${MIN_HOST_SERVICE_VERSION}`)) { + return { + status: "incompatible", + hostName: hostRow?.name ?? "Unknown host", + hostVersion, + minVersion: MIN_HOST_SERVICE_VERSION, + }; + } } return { status: "ready" }; diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx index 4b3516070aa..05a8de21c94 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx @@ -8,7 +8,6 @@ import { useWorkspaceCreatesStore } from "renderer/stores/workspace-creates"; import { WorkspaceCreateErrorState } from "./components/WorkspaceCreateErrorState"; import { WorkspaceCreatingState } from "./components/WorkspaceCreatingState"; import { WorkspaceHostIncompatibleState } from "./components/WorkspaceHostIncompatibleState"; -import { WorkspaceHostOfflineState } from "./components/WorkspaceHostOfflineState"; import { WorkspaceNotFoundState } from "./components/WorkspaceNotFoundState"; import { useRemoteHostStatus } from "./hooks/useRemoteHostStatus"; import { WorkspaceProvider } from "./providers/WorkspaceProvider"; @@ -84,9 +83,6 @@ function V2WorkspaceLayout() { return ; } - if (hostStatus.status === "offline") { - return ; - } if (hostStatus.status === "incompatible") { return (