diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index fc2eac83..e95043f0 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -1098,7 +1098,7 @@ export default function Home() { window.clearTimeout(bootstrapTimeout); controller.abort(); }; - }, [setProfile, setProfileDraft]); + }, []); useEffect(() => { if (!hydrated || uiPreview.current) return; diff --git a/frontend/tests/chat-navigation-a11y-contract.test.ts b/frontend/tests/chat-navigation-a11y-contract.test.ts index a49c9a2a..8f96de5f 100644 --- a/frontend/tests/chat-navigation-a11y-contract.test.ts +++ b/frontend/tests/chat-navigation-a11y-contract.test.ts @@ -76,7 +76,12 @@ test("auth redirects stay hard document loads so stale session state cannot surv assert.doesNotMatch(pageSource, /router\.replace\("\/login"\)/); // And: the login redirect after sign-out drops the whole React tree with the session. - const signOut = sourceBetween(pageSource, "async function signOut()", "return {\n refreshAccount,"); + // 原值: sourceBetween(..., "async function signOut()", "return {\n refreshAccount,") + // 新值: 同一起点,终点改成 "return {\n profile," + // 原因: 状态下沉第二批把六个 profile 状态搬进 use-profile-onboarding.ts,hook 的 + // return 现在以 profile 开头,refreshAccount 不再是第一个字段。切的还是 + // signOut 函数体,断言主语(退出后硬跳 /login)一字未改。 + const signOut = sourceBetween(pageSource, "async function signOut()", "return {\n profile,"); assert.match(signOut, /await selfHostedOtpActions\.signOut\(\);\n\s*window\.location\.assign\("\/login"\)/); // And: the billing pane keeps the same 401 precedent without a dedicated membership page.