fix(desktop): restore the typecheck by completing the typing-sync harness

`main` is red. 68518c1f9b added a dedicated `renderTypingSync` harness for the
typing-aware deferral tests, but its params object omits `updateSessionState`,
which `BackgroundSyncParams` requires:

    src/app/contrib/hooks/use-background-sync.test.ts(660,25): error TS2345:
    Property 'updateSessionState' is missing in type '{ ... }' but required
    in type 'BackgroundSyncParams'.

`npm run typecheck` exits 2, so `apps/desktop :: check:lint` fails and the
JS & TS checks job goes red on every open PR regardless of its contents.

Vitest did not catch this because it transpiles without typechecking, so the
new suite passes while `tsc -p .` fails.

Supply the missing prop. The updater runs against a throwaway state — this
harness never exercises the transcript path — and it is added to the existing
`stable` object rather than inline, because the harness's own comment requires
every param to keep a stable identity across the tick-driven re-renders; a
fresh `vi.fn()` per render would re-run the connect-reseed effect and
re-subscribe the throttle, polluting the very counts the tests observe.

Verified: all three tsc projects clean (`tsc -p .`, `tsconfig.electron.json`,
`tsconfig.e2e.json`), use-background-sync suites 26/26, eslint clean.
This commit is contained in:
Trevor Nash-Keller
2026-08-26 15:46:09 -05:00
committed by brooklyn!
parent 68518c1f9b
commit 15b673d178
@@ -653,7 +653,19 @@ describe('typing-aware sessions.changed deferral', () => {
refreshCurrentModel: vi.fn(),
refreshHermesConfig: vi.fn(),
refreshMessagingSessions: vi.fn(),
requestGateway: vi.fn(async () => ({ sessions: [] })) as never
requestGateway: vi.fn(async () => ({ sessions: [] })) as never,
// Required by the hook's params. This harness never drives the
// transcript path, so the updater just runs against a throwaway state —
// but it must live in `stable` like every other prop, since a fresh
// identity per render would re-run the connect-reseed effect.
updateSessionState: vi.fn(
(
_sessionId: string,
updater: (state: ReturnType<typeof createClientSessionState>) => ReturnType<
typeof createClientSessionState
>
) => updater(createClientSessionState(ACTIVE_STORED_ID))
)
}
return renderHook(() => {