Skip to content

The agent that grows with you

fix(desktop): the starting screen's way out releases the boot hold

alt-glitch3403898c27fc
diff --git a/apps/desktop/src/store/onboarding-run.test.ts b/apps/desktop/src/store/onboarding-run.test.ts
index 881d3161e14..6aa6ea6e505 100644
--- a/apps/desktop/src/store/onboarding-run.test.ts
+++ b/apps/desktop/src/store/onboarding-run.test.ts
@@ -205,6 +205,22 @@ describe('onboarding run', () => {
expect(calls).toContain('free_tier.ack_notice')
})
+ it('releases the boot hold when the user takes the way out while the start is still pending', async () => {
+ let exit: () => void = () => undefined
+ const intro = { failed: vi.fn(), opened: vi.fn(), started: vi.fn(), starting: (leave: () => void) => (exit = leave) }
+
+ const request = (method: string) =>
+ method === 'onboarding.start' ? new Promise<never>(() => undefined) : Promise.reject(new Error(method))
+
+ $onboardingDecided.set(false)
+
+ // `starting` runs before the first await, so the way out exists as soon as the start is called.
+ void startOnboarding(request, resume, { ensureProfile, intro })
+ exit()
+
+ expect($onboardingDecided.get()).toBe(true)
+ })
+
it("keeps a rerun going when the old run's withdrawn card reports skipped_all first", async () => {
const { request } = backend({ eligible: true, run: true })
await startOnboarding(request, resume, { ensureProfile })
diff --git a/apps/desktop/src/store/onboarding-run.ts b/apps/desktop/src/store/onboarding-run.ts
index 00f4870e429..2e73701a21b 100644
--- a/apps/desktop/src/store/onboarding-run.ts
+++ b/apps/desktop/src/store/onboarding-run.ts
@@ -127,6 +127,8 @@ export async function startOnboarding(
skipped = true
intro?.failed()
leaveSkipped()
+ // The start has no deadline behind the intro; the boot hold must not wait for it once the user left.
+ markOnboardingDecided()
})
try {