diff --git a/apps/desktop/electron/close-stop-kill.test.ts b/apps/desktop/electron/close-stop-kill.test.ts index f80253dbc5..c9287d6af3 100644 --- a/apps/desktop/electron/close-stop-kill.test.ts +++ b/apps/desktop/electron/close-stop-kill.test.ts @@ -44,21 +44,25 @@ test('close/stop inventories owned PIDs after the tree kill and clears only unhe const cleared: string[] = [] const alive = new Set([9001]) - const result = finishWindowsCloseStop([4242, 9001], [ - { path: 'gone.lock', holderPids: [4242] }, - { path: 'still-held.lock', holderPids: [9001] }, - { path: 'foreign-held.lock', holderPids: [7777], held: true }, - { path: 'no-holder.lock', holderPids: [] } - ], { - killTree: pid => { - killed.push(pid) - alive.delete(pid === 4242 ? 4242 : -1) - }, - isPidAlive: pid => alive.has(pid), - clearLock: path => { - cleared.push(path) + const result = finishWindowsCloseStop( + [4242, 9001], + [ + { path: 'gone.lock', holderPids: [4242] }, + { path: 'still-held.lock', holderPids: [9001] }, + { path: 'foreign-held.lock', holderPids: [7777], held: true }, + { path: 'no-holder.lock', holderPids: [] } + ], + { + killTree: pid => { + killed.push(pid) + alive.delete(pid === 4242 ? 4242 : -1) + }, + isPidAlive: pid => alive.has(pid), + clearLock: path => { + cleared.push(path) + } } - }) + ) assert.deepEqual(killed, [4242, 9001], 'does not widen the tree-kill to foreign holders') assert.deepEqual(result.remainingPids, [9001]) diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts index 6e534e7c63..8db0a92b11 100644 --- a/apps/desktop/electron/main.ts +++ b/apps/desktop/electron/main.ts @@ -12340,12 +12340,15 @@ function releaseHostSpawnReservation() { hostSpawnReservation = null } -function startHermes({ supervisorRecovery = false }: { supervisorRecovery?: boolean } = {}): Promise>> { +function startHermes({ supervisorRecovery = false }: { supervisorRecovery?: boolean } = {}): Promise< + Awaited> +> { primaryRecoverySuppressed = false primaryStartsInFlight += 1 - const start: Promise>> = - localBackendLifecycle.start(() => runHermesStart({ supervisorRecovery })) + const start: Promise>> = localBackendLifecycle.start( + () => runHermesStart({ supervisorRecovery }) + ) const releaseStart = (): void => { primaryStartsInFlight -= 1 @@ -12461,7 +12464,9 @@ function latchedBootFailure(): Error | null { return bootstrapFailure ?? backendStartFailure ?? remoteReauthFailure ?? null } -async function runHermesStart({ supervisorRecovery = false }: { supervisorRecovery?: boolean } = {}): Promise>> { +async function runHermesStart({ supervisorRecovery = false }: { supervisorRecovery?: boolean } = {}): Promise< + Awaited> +> { // Only the single-instance lock holder may reap/spawn/claim the desktop // backend. A lock-losing instance must stay inert even if some path reaches // here (e.g. the deferred-quit window before `ready`): its reapOrphans()