From 1782bf79c8bc6e3fa93e71d7439422f0ff2cd73e Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Mon, 14 Sep 2026 06:22:08 -0700 Subject: [PATCH] test(desktop): contract-skew tests read REQUIRED_BACKEND_CONTRACT instead of a frozen 6 --- apps/desktop/src/store/updates.test.ts | 5 +++-- apps/desktop/src/store/updates.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/store/updates.test.ts b/apps/desktop/src/store/updates.test.ts index 1fbd284d93..92d1723677 100644 --- a/apps/desktop/src/store/updates.test.ts +++ b/apps/desktop/src/store/updates.test.ts @@ -85,6 +85,7 @@ const { $backendUpdateStatus, applyBackendUpdate, $backendUpdateApply, + REQUIRED_BACKEND_CONTRACT, reportBackendContract, applyUpdates, applyEverythingUpdate, @@ -194,7 +195,7 @@ describe('reportBackendContract', () => { }) it('dismisses the toast when the backend meets the contract', () => { - reportBackendContract(6) + reportBackendContract(REQUIRED_BACKEND_CONTRACT) expect(dismissSpy).toHaveBeenCalledWith('backend-contract-skew') expect(notifySpy).not.toHaveBeenCalled() }) @@ -234,7 +235,7 @@ describe('reportBackendContract', () => { lastToast().onDismiss() notifySpy.mockClear() - reportBackendContract(6) // backend updated → satisfied, snooze cleared + reportBackendContract(REQUIRED_BACKEND_CONTRACT) // backend updated → satisfied, snooze cleared reportBackendContract(5) // a later regression must warn immediately expect(notifySpy).toHaveBeenCalledTimes(1) }) diff --git a/apps/desktop/src/store/updates.ts b/apps/desktop/src/store/updates.ts index e2ff292f72..06fedccfe7 100644 --- a/apps/desktop/src/store/updates.ts +++ b/apps/desktop/src/store/updates.ts @@ -105,7 +105,7 @@ function isUpdateToastSnoozed(): boolean { // v7: requires JSON-RPC server->client requests for every blocking prompt // (approval/clarify/sudo/secret/vault/MCP setup); a v6 backend's // `.request` notifications would never render a card. -const REQUIRED_BACKEND_CONTRACT = 7 +export const REQUIRED_BACKEND_CONTRACT = 7 const SKEW_TOAST_ID = 'backend-contract-skew' // The contract check runs on every session.resume (applyRuntimeInfo), so // without a snooze the warning re-popped on every thread the user opened, even