report daemon-down as DaemonUnavailable on initial Peers.Get and gate UI

- Peers.Get returns Status{Status: DaemonUnavailable} on Unavailable
  instead of an error so the React useStatus initial refresh picks up
  the same string the live event stream emits — the overlay no longer
  depends on receiving the synthetic event during boot.
- ProfileContext.refresh swallows Unavailable so the redundant
  "Load Profiles Failed" popup does not overlap the overlay.
- Tray Profiles submenu is disabled while the daemon is unavailable,
  matching the existing settings/debug/connect gating.
- gRPC client uses a 5s ConnectParams MaxDelay; the default 120s cap
  was keeping the SubChannel in backoff for tens of seconds after the
  daemon came back, masking the recovery.
This commit is contained in:
Zoltan Papp
2026-05-18 12:33:46 +02:00
parent f84b1df857
commit 6b44d65cac
4 changed files with 42 additions and 2 deletions

View File

@@ -56,9 +56,17 @@ export const ProfileProvider = ({ children }: { children: ReactNode }) => {
setActiveProfile(active.profileName || "default");
setProfiles(list);
} catch (e) {
// Daemon-down is already surfaced globally by
// DaemonUnavailableOverlay; a second popup on top of it is
// pure noise. Every profile RPC routes through the same gRPC
// conn, so the Unavailable code is the reliable marker.
const msg = e instanceof Error ? e.message : String(e);
if (msg.includes("code = Unavailable")) {
return;
}
await Dialogs.Error({
Title: i18next.t("profile.error.loadTitle"),
Message: e instanceof Error ? e.message : String(e),
Message: msg,
});
} finally {
setLoaded(true);