Require explicit review for restored Vaults

This commit is contained in:
vorotamoroz
2026-07-19 07:05:22 +00:00
parent d28282edad
commit f0ec046cf4
14 changed files with 410 additions and 121 deletions
@@ -4,7 +4,11 @@ import {
DATABASE_COMPATIBILITY_VERSION_KEY,
legacyDatabaseCompatibilityVersionKey,
} from "@/common/databaseCompatibility.ts";
import { CompatibilityReviewController, type CompatibilityReviewUi } from "./compatibilityReview.ts";
import {
CompatibilityReviewController,
type CompatibilityReviewUi,
useCompatibilityReview,
} from "./compatibilityReview.ts";
function migrationState(overrides: Record<string, unknown> = {}) {
return {
@@ -161,4 +165,26 @@ describe("compatibility review controller", () => {
expect(fixture.ui.showSummary).not.toHaveBeenCalled();
expect(fixture.ui.clearReminder).toHaveBeenCalledOnce();
});
it("runs the review after the ordered red flag recovery handlers", () => {
const onSettingLoaded = { addHandler: vi.fn() };
const onLayoutReady = { addHandler: vi.fn() };
const onUnload = { addHandler: vi.fn() };
const core = {
services: {
appLifecycle: { onSettingLoaded, onLayoutReady, onUnload },
API: { addCommand: vi.fn() },
},
} as never;
const ui: CompatibilityReviewUi = {
showSummary: vi.fn(),
showDetails: vi.fn(),
showReminder: vi.fn(),
clearReminder: vi.fn(),
};
useCompatibilityReview(core, ui);
expect(onLayoutReady.addHandler).toHaveBeenCalledWith(expect.any(Function), 30);
});
});