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.
This commit is contained in:
kshitijk4poor 2026-06-24 18:11:10 +05:30 committed by kshitij
parent 7243111c57
commit d398076c21
2 changed files with 33 additions and 0 deletions

View file

@ -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') {

View file

@ -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
}