fix: recover account subscription state

This commit is contained in:
2569718930@qq.com
2026-05-27 12:14:07 +08:00
parent 7ff1d21b95
commit fb7e27d9ed
6 changed files with 155 additions and 14 deletions
@@ -139,6 +139,20 @@ export function runTests() {
accountCenterSource.includes('trackAppEvent("dashboard_active"'),
"account center must emit signup_completed and dashboard_active so the ops funnel has top-of-funnel data",
);
assert(
accountCenterSource.includes("isSubscriptionUnknown") &&
accountCenterSource.includes("subscriptionStatusLabel") &&
!accountCenterSource.includes(
'backend?.subscription_active);',
),
"account center must distinguish unknown subscription sync state from a confirmed unsubscribed account",
);
assert(
hookSource.includes("backendJson.authenticated === false") &&
hookSource.includes("refreshSession()") &&
hookSource.includes("retriedBackendJson"),
"account snapshot loader must retry with a refreshed Supabase token when local user exists but /api/auth/me reports unauthenticated",
);
assert(
subscriptionsPageSource.includes("getSupabaseBrowserClient") &&
subscriptionsPageSource.includes("refreshSession") &&