docs(home): record slow-network acceptance

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
jesse-ux
2026-09-24 18:22:44 +08:00
co-authored by Claude Code
parent 25e32fe6fd
commit 1d1983b484
10 changed files with 159 additions and 21 deletions
-1
View File
@@ -7,7 +7,6 @@ import { EpayConfigurationError, resolveEpayConfig } from "../src/lib/epay/confi
import { assertConfiguredEpayUrl, assertPublicEpayGateway, assertPublicGatewayUrl, isPublicEpayAddress } from "../src/lib/epay/gateway-policy";
const root = new URL("../", import.meta.url);
const readProjectFile = (path: string) => readFileSync(new URL(path, root), "utf8");
const route = readFileSync(new URL("src/app/api/admin/epay-settings/route.ts", root), "utf8");
const management = readFileSync(new URL("src/components/admin/payment-management.tsx", root), "utf8");
const createRoute = readFileSync(new URL("src/app/api/payment/epay/create/route.ts", root), "utf8");
@@ -15,7 +15,7 @@ test("packages load on mount without a redundant account request", () => {
// 原值: 挂载并发 fetchAccountData() 与 fetchPackages(),并锁定 Promise.allSettled。
// 新值: 挂载只执行 fetchPackages(),账户余额来自首页 bootstrap;成功兑换/支付使用接口返回 credits 通过共享事件同步。
// 原因: BUG-1022 / TASK-home-slow-network D5,删除无用的完整 /api/account 请求,避免重复数据库读取。
assert.match(hookSource, /void fetchPackages\(\);/);
assert.match(hookSource, /setTimeout\(\(\) => void fetchPackages\(\), 0\)/);
assert.doesNotMatch(hookSource, /Promise\.allSettled\(\[fetchAccountData\(\), fetchPackages\(\)\]\)/);
assert.doesNotMatch(hookSource, /fetchAccountData/);
assert.doesNotMatch(hookSource, /fetch\("\/api\/account"/);