When the desktop app is offline, opening it fails with:

[failed_precondition] Get "https://hyper.media/vault/api/vault-email": dial tcp: lookup hyper.media: no such host

The error replaces the whole UI instead of degrading gracefully. The desktop app must be resilient to network status.

Diagnosis

    The daemon wraps any GetVaultEmail failure — including the DNS error — as FailedPrecondition (backend/api/daemon/v1alpha/daemon.go).

    The frontend useVaultEmail query is mounted inside AccountProfileButton in the titlebar (always rendered). It fires because the daemon still reports the remote vault as CONNECTED (cached status; it doesn't know the network is gone).

    The shared QueryClient defaults are useErrorBoundary: true, retry: 4, networkMode: 'always', plus onlineManager.setOnline(true) in root.tsx. React Query retries 4 times, then throws into React.

    The throw hits the app-wide RootAppError ErrorBoundary in root.tsx, so the entire UI is replaced by the error screen.

    Nearby non-critical queries (useVaultStatus, useDaemonInfo) already opt out with useErrorBoundary: false; useVaultEmail and useVaultPasswordStatus were missing it.

Proposal


    [DONE] Stop throwing non-critical query errors into the app-wide error boundary. Added useErrorBoundary: false to useVaultEmail and useVaultPasswordStatus (frontend/apps/desktop/src/models/daemon.ts), so a failed vault request now leaves the query in isError state instead of crashing the app. Implemented in PR #1403.

    Quieter offline behavior. Today the app forces onlineManager.setOnline(true) and networkMode: 'always', so offline users still get 4 retries plus a global "Failed to Load" toast. Options:

      Gate enabled on navigator.onLine (or a connectivity signal from the daemon) for remote-only queries like vault email.

      Add meta: {handlesErrorLocally: true} to suppress the global toast for queries the UI already handles, and/or surface a single "you're offline" indicator instead of per-query toasts.

      Longer term: stop forcing onlineManager.setOnline(true) for remote (non-localhost) queries, so React Query pauses them automatically while offline.

    Audit other remote-dependent queries for the same pattern — any query without useErrorBoundary: false that hits a remote endpoint can crash the whole app the same way.

Solution

PR #1416 keeps vault email and vault password-status query errors local with useErrorBoundary: false, preventing an offline failure from replacing the entire desktop UI. It adds a regression test. This is the same production change as PR #1403, with regression coverage; the reviewer should resolve the duplicate PRs.

Root cause: the daemon continues reporting the remote vault as CONNECTED offline. The always-mounted titlebar account button requests the vault email; the failure becomes FailedPrecondition. Shared query defaults throw the error after retries into the app-wide RootAppError boundary.

Verification reported by T3: vault-query-errors.test.tsx failed on unmodified main in two runs and passes 2/2 with the fix. The new tests plus account-profile-button tests passed 15/15. Desktop typecheck and Prettier checks on touched files passed. Full CI and agent-ci were not run.

Desktop recording: real Electron v44 ran headless with remote debugging, a locally built daemon using in-memory vault secrets and an isolated dev-testnet data directory, and a local vault on port 3030. CDP interception simulated vault status CONNECTED and GetVaultEmail / GetVaultPasswordStatus failures with FAILED_PRECONDITION: dial tcp: connect: connection refused. Each run reloaded the window and waited about 40 seconds for retries. Main showed the full-window error screen; the fix branch kept the UI usable and the account menu opened. Recordings are approximately 24 seconds at 2 fps. No code changed in this follow-up; the PR description was updated.

Limitation: this is a simulated offline vault failure in the real app, not an actual network drop with a genuinely connected vault. Real Vault Connect sign-in could not be completed headless without OS keyring and passkey support. That real-world check remains outstanding.

Before / After

Before — main

main final state: RootAppError screen showing the failedprecondition vault-email error

Main final state: RootAppError replaces the UI after the simulated offline vault failure.

Before recording (24.5 seconds): after the offline vault failure, reloading ends on the full-screen “Something went wrong” error screen (vault failure simulated via CDP interception).

After — fix branch

Fix branch final state: the normal app UI with titlebar, spaces and documents

Fix branch final state: the normal UI remains visible with titlebar, spaces and documents.

After recording (24 seconds): with the same simulated failure and steps, the UI stays usable and the account menu opens.

Remaining scope: quieter offline behavior, auditing other remote queries, and daemon-side email caching are not included. Offline users may still see a “Failed to Load” toast.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Comments