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 DNS failure becomes FailedPrecondition. Shared query defaults throw the error after retries into the app-wide RootAppError boundary.

Verification reported by T3: pnpm exec vitest run src/models/__tests__/vault-query-errors.test.tsx failed for both hooks on unmodified origin/main in two separate runs, rendering the error-boundary fallback. With the fix, both tests passed. The new tests plus existing account-profile-button.test.tsx tests passed 15/15. Desktop typecheck and Prettier checks on both touched files passed. Full CI and agent-ci were not run.

Before / After


    Before (regression test): both vault query failures rendered the app-wide error fallback on unmodified code.

    After (same regression test): both query failures stayed local and the tests passed with the fix.

No before/after images or videos were supplied. Desktop/Electron visual verification was blocked by the sandbox's missing display server and OS keyring; the connected-then-offline state could not be reached manually. These are test observations, not visual captures.

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