refactor(*): 稳定期治理 - 收敛核心架构、错误语义并修复跨项目数据竞态

This commit is contained in:
ddCat
2026-09-09 22:02:10 +08:00
parent bacd502f5c
commit b5f3413ded
298 changed files with 12681 additions and 26428 deletions

View File

@@ -71,6 +71,18 @@ describe("workspace route loading", () => {
expect(canvas).toContain("deleteDialogOpen ? <Suspense");
});
test("keeps project asset refresh scoped to the latest user and project", () => {
const editor = source("../src/pages/projects/detail/editor.tsx");
expect(editor).toContain("const assetOwnerKey = JSON.stringify([scope, projectId])");
expect(editor).toContain("activeAssetOwnerKeyRef.current !== requestedOwnerKey");
expect(editor).toContain("assetRefreshSequenceRef.current !== requestSequence");
expect(editor).toContain("assetRefreshSequenceRef.current += 1");
expect(editor).toContain("syncedAssetOwnerKeyRef.current = assetOwnerKey");
expect(editor.match(/listProjectAssets\(projectId\)/g)).toHaveLength(1);
});
test("does not poll wallet balance from permanent workspace chrome", () => {
const wallet = source("../src/hooks/use-wallet-balance.ts");
expect(wallet).not.toContain("refetchInterval:");
@@ -97,8 +109,8 @@ describe("workspace route loading", () => {
const loader = source("../src/components/ui/aceternity/full-screen-loader.tsx");
const css = source("../src/styles/globals.css");
expect(loader).toContain("full-screen-loader-topbar");
expect(loader).toContain("full-screen-loader-rail");
expect(loader).toContain("full-screen-loader-scene");
expect(loader).toContain("full-screen-loader-guide");
expect(loader).toContain("LoadingSignal");
expect(loader).not.toContain("YINGCE STUDIO");
expect(loader).not.toContain("loading-cue");