authorgravatar for admin@snappeh.comTristan Knight <admin@snappeh.com> 2026-09-26 20:59:18+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-26 14:59:18-05:00
logdd582dee36976ccfd2a896cf50c3ee957ca7b9be
treede5b22fb795fee107045d4dcf30ed41aadc0691e
parent3dae78f33b1e3c7534feb51ca41a407ab2536b83
signature Signed by PGP key B5690EEEBB952194

fix(web): stop mistaking offline servers for updates (#13083)


1 files changed, 25 insertions(+), 53 deletions(-)

apps/web/src/components/ChatView.tsx+25-53
......@@ -2705,68 +2705,40 @@ export default function ChatView(props: ChatViewProps) {
27052705 unavailableConnection !== null &&
27062706 (unavailableConnection.phase === "connecting" ||
27072707 unavailableConnection.phase === "reconnecting");
2708 // Reconnecting to a version-skewed server with no update in flight
2709 // usually means the server is restarting mid-update and a refresh wiped
2710 // the in-memory update state. Fold the reconnect and version banners
2711 // into one calm line instead of stacking "Failed to connect" on
2712 // "versions differ". A failed update never folds: its error and retry
2713 // action must stay visible.
2714 const reconnectingThroughVersionSkew =
2715 serverUpdateState.status === "idle" && environmentReconnecting && versionMismatch !== null;
27162708 // While an update runs, transient connect blips are expected (the server
27172709 // restarts) and the update banner already shows progress. Hard failure
27182710 // phases still surface so the Reconnect action stays reachable.
27192711 const suppressUnavailableBanner =
2720 environmentReconnecting &&
2721 (updateRunning || (!reconnectingThroughVersionSkew && !reconnectWarningGraceElapsed));
2712 environmentReconnecting && (updateRunning || !reconnectWarningGraceElapsed);
27222713 if (activeEnvironmentUnavailableState && unavailableConnection && !suppressUnavailableBanner) {
2723 if (reconnectingThroughVersionSkew) {
2724 items.push({
2725 id: `environment-unavailable:${activeEnvironmentUnavailableState.environmentId}`,
2726 variant: "default",
2727 // Prioritize live connection progress among the notices.
2728 priority: "urgent",
2729 icon: (
2730 <span
2731 className="size-1.5 animate-status-pulse rounded-full bg-foreground"
2732 aria-hidden="true"
2733 />
2734 ),
2735 title: `${unavailableConnection.phase === "connecting" ? "Connecting" : "Reconnecting"} to ${activeEnvironmentUnavailableState.label}`,
2736 description: "Finishing an update",
2737 actions: disconnectAction,
2738 });
2739 } else {
2740 items.push({
2741 id: `environment-unavailable:${activeEnvironmentUnavailableState.environmentId}`,
2742 variant: unavailableConnection.phase === "error" ? "error" : "warning",
2743 icon: <WifiOffIcon />,
2744 title: `${activeEnvironmentUnavailableState.label} is ${environmentReconnecting ? "reconnecting" : "offline"}`,
2745 actions: (
2746 <>
2747 {!environmentReconnecting ? (
2748 <Button
2749 size="xs"
2750 variant="ghost"
2751 onClick={() =>
2752 void handleReconnectActiveEnvironment(
2753 activeEnvironmentUnavailableState.environmentId,
2754 )
2755 }
2756 >
2757 Reconnect
2758 </Button>
2759 ) : null}
2760 {disconnectAction}
2761 </>
2762 ),
2763 });
2764 }
2714 items.push({
2715 id: `environment-unavailable:${activeEnvironmentUnavailableState.environmentId}`,
2716 variant: unavailableConnection.phase === "error" ? "error" : "warning",
2717 icon: <WifiOffIcon />,
2718 title: `${activeEnvironmentUnavailableState.label} is ${environmentReconnecting ? "reconnecting" : "offline"}`,
2719 actions: (
2720 <>
2721 {!environmentReconnecting ? (
2722 <Button
2723 size="xs"
2724 variant="ghost"
2725 onClick={() =>
2726 void handleReconnectActiveEnvironment(
2727 activeEnvironmentUnavailableState.environmentId,
2728 )
2729 }
2730 >
2731 Reconnect
2732 </Button>
2733 ) : null}
2734 {disconnectAction}
2735 </>
2736 ),
2737 });
27652738 }
27662739 if (
27672740 !automaticEnvironment &&
27682741 serverUpdateEnvironmentId &&
2769 !reconnectingThroughVersionSkew &&
27702742 (serverUpdateState.status === "idle"
27712743 ? showVersionMismatchBanner
27722744 : !serverUpdateFailureDismissed)