From d398076c21175458003fed2d64c8339ed8861293 Mon Sep 17 00:00:00 2001 From: kshitijk4poor Date: Wed, 24 Jun 2026 18:11:10 +0530 Subject: [PATCH] fix(desktop): show non-blocking notification on fallback runtime probe When shouldPreserveConfiguredOnFallback keeps configured=true, also call notifyError('runtime-not-ready', ...) so the user knows the backend wasn't verified instead of silently proceeding. Adapted from @mohamedorigami-jpg's approach in PR #37634. --- apps/desktop/src/store/onboarding.test.ts | 25 +++++++++++++++++++++++ apps/desktop/src/store/onboarding.ts | 8 ++++++++ 2 files changed, 33 insertions(+) diff --git a/apps/desktop/src/store/onboarding.test.ts b/apps/desktop/src/store/onboarding.test.ts index ffd06b912d0..0184ac5b64b 100644 --- a/apps/desktop/src/store/onboarding.test.ts +++ b/apps/desktop/src/store/onboarding.test.ts @@ -154,6 +154,31 @@ describe('refreshOnboarding', () => { expect(window.localStorage.getItem('hermes-desktop-onboarded-v1')).toBeNull() }) + it('shows a non-blocking notification when preserving configured on fallback', async () => { + const notifyErrorSpy = vi.spyOn( + await import('@/store/notifications'), + 'notifyError' + ) + + installApiMock(vi.fn()) + $desktopOnboarding.set( + baseState({ + configured: true, + providers: [provider('cached')], + reason: null, + requested: false + }) + ) + + await refreshOnboarding(onboardingContext(fallbackTimeoutGateway())) + + expect(notifyErrorSpy).toHaveBeenCalledWith( + 'runtime-not-ready', + expect.stringContaining('could not verify the running backend') + ) + expect($desktopOnboarding.get().configured).toBe(true) + }) + it('still surfaces onboarding when fallback failure happens before configured state', async () => { const api = vi.fn(async ({ path }: { path: string }) => { if (path === '/api/providers/oauth') { diff --git a/apps/desktop/src/store/onboarding.ts b/apps/desktop/src/store/onboarding.ts index 17a12621e6c..b5de18d64b5 100644 --- a/apps/desktop/src/store/onboarding.ts +++ b/apps/desktop/src/store/onboarding.ts @@ -526,6 +526,14 @@ export async function refreshOnboarding(ctx: OnboardingContext) { const state = $desktopOnboarding.get() if (shouldPreserveConfiguredOnFallback(runtime, state)) { + // Gateway probes timed out but the user was already configured — don't + // downgrade to the blocking onboarding overlay. Surface a non-blocking + // notification so the user knows the backend wasn't verified. + notifyError( + 'runtime-not-ready', + 'Hermes Desktop could not verify the running backend on startup. Some features may be unavailable until the gateway is reachable.' + ) + return false }