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