Repository navigation
fix(billing-web): no "Sign-in is unavailable" flash while sign-in is still resolving - #21146
Conversation
…is still resolving The sign-in page keyed the unavailable notice on "no Firebase identity yet", which is also true for the whole time the identity config is being fetched. Every cold load of /sign-in therefore flashed "Sign-in is unavailable right now." before the providers appeared (seen during the IR-146 re-test on production). The controller now reports identityStatus as resolving | ready | unavailable. The notice and its retry only render once resolution has actually failed; while resolving, the provider buttons stay disabled. The existing 4s config-fetch timeout still ends a hung request in unavailable.
📦 Bundle Size
🔬 E2E Coverage
🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measureExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight This candidate changes nothing the matrix measures, so every expensive stage was skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md 🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 89bb14be8eeb9fdda119f87999264b695ccf15fe
Full docs: ADR-DEVEX-LINT-0015 💳 Billing Web PreviewBilling Web Preview: https://comfy-billing-web-preview-pr-21146.vercel.app This commit: https://billing-50nnsnsvm-comfyui.vercel.app |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #21146 +/- ##
==========================================
+ Coverage 86.46% 87.37% +0.91%
==========================================
Files 3717 2747 -970
Lines 176619 151233 -25386
Branches 48812 41744 -7068
==========================================
- Hits 152710 132144 -20566
+ Misses 21848 18541 -3307
+ Partials 2061 548 -1513
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 970 files with indirect coverage changes 🚀 New features to boost your workflow:
|
christian-byrne
left a comment
There was a problem hiding this comment.
Read the fix end to end: useSignInController now reports a three-way identityStatus (resolving/ready/unavailable) instead of the old boolean available, so SignInView no longer shows "Sign-in is unavailable" during the initial fetch. The controller and view test updates match that intent, and the two billingWebAuth.flagOff tests now correctly assert the opposite of the old undecided-first-render behavior.
One confirmed CI failure, not pending debris: the fallow / fallow dead-code gate ran to completion (13.5s analysis, new-only mode) and found one real new-only issue — IdentityStatus (useSignInController.ts:37) is exported but only consumed inside the same file (as the type parameter to computed<IdentityStatus>). No other file in this diff imports it. Dropping the export keyword (or inlining the union where it's used) would clear the gate.
lint-pr/typecheck, pr-risk/Grade PR risk, and CodeRabbit are still pending at this head, so this review doesn't speak to those yet.
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 6 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 2944ced | Docs | View more details | Give us feedback! |
|
Dropped the |
christian-byrne
left a comment
There was a problem hiding this comment.
Confirmed on 2944cedff8: the export keyword on IdentityStatus (useSignInController.ts:37) is dropped, matching the fallow dead-code finding from the prior review exactly — the type is used only within the same file via computed<IdentityStatus>. No other touched file imported it, so this is a clean fix with no follow-on break. CI settled (49 pass / 46 skip, no failures), no open threads. Approving.
…Org#21170) ## Summary Removes the core app's in-app embedded checkout (the Stripe Payment Element rendered inside the cloud pricing dialog) and the core frontend's reads of `embedded_checked_enabled`. Checkout UI now lives on billing-web; the core app always takes today's flag-off path: the Stripe hosted page or billing-web, chosen by `hosted_billing_destination`. ## Why - **No customer traffic.** PostHog `billing.checkout.entered` with `ui_mode=embedded`, last 14 days: 599 entries on billing.comfy.org, and **2 entries from 1 person on cloud.comfy.org**. In prod the flag targets a single test account. - **It shadows billing-web.** With the flag on, the core app opens its own card form *before* consulting `hosted_billing_destination`, so an account routed to billing-web never reaches it. This is the screen QA saw on testcloud with only `embedded_checked_enabled` on. - IR-146 follow-up: billing-web is the checkout surface; keeping a second, unused checkout in the core app doubles the payment paths to test and to break. Discussed in #proj-billing (thread on `embedded_checked_enabled`). The ingest change that makes billing-web independent of the flag is separate (cloud, Wei). ## How - `useFeatureFlags` / `ServerFeatureFlag` / remote-config types: drop `embeddedCheckoutEnabled` and `embedded_checked_enabled`. - `useSubscriptionCheckout`: remove every embedded branch: saved payment methods, promo previews, quote identity and stale-quote recovery, confirmation tokens, the embedded reactivation decision, `paymentReturnUrl()`. Return URL is always `/payment/success`; journey `uiMode` is always `hosted`. - Subscription dialog components: collapse to the flag-off layout. - `billingSdkStore` / `createBillingSdk` / `billingOperationStore` / `useTopupOperation`: remove Stripe loading, in-page 3DS challenge driving and retry, and the challenge-paused polling. Flag-off polling order is unchanged. - Delete `usePaymentReturnUrlLoader`, `stripePublishableKey.ts`, the Payment Element test, and the `embeddedCheckoutSdkRail` e2e spec. `stripPaymentReturnParams` stays. - Remove the unused core `VITE_STRIPE_PUBLISHABLE_KEY` (billing-web keeps its own), four embedded-only i18n keys, and stale oxlint suppression counts. **Kept on purpose:** - `resolveCheckoutAssignment` still records the server-assigned `embedded_checked_enabled` arm in checkout telemetry (ADR BILLING-CHECKOUT-0031). It's passed through, not used for a decision. - The operation types' authentication fields stay, because both rails' projections use them. - billing-web, `packages/account-ui`, `packages/account-core` and ingest types are untouched. **Behaviour delta for flag-off users:** none expected. The only visible removal is the top-up "resume challenge" button, which needed an in-page challenge and so could not appear with the flag off. Non-test diff: +47 / −1095 (53 files incl. tests, +180 / −4515). ## Verification - `pnpm exec vitest run src/platform/workspace src/platform/cloud/subscription src/composables src/components/dialog/GlobalDialog.test.ts`: 287 files, 5693 passed. - `pnpm typecheck`, oxlint (type-aware), eslint, oxfmt, knip: clean (git hooks also ran). - Removed tests covered only embedded behaviour; flag-off coverage kept and extended. New tests: Backspace returns to pricing; Stripe params are stripped; a stale verification link is hidden after a failed attempt; `authentication_state === 'reconciliation_needed'` alone no longer reconciles. - QA: QA accounts with `embedded_checked_enabled` overridden on should now land on billing-web (or the Stripe page) from the core app, never the in-app card form. | | AS IS (testcloud, `embedded_checked_enabled` on) | TO BE | |---|---|---| | Subscribe from the core app | _pending_ (in-app card form inside the pricing dialog) | _pending_ (opens billing-web / Stripe page) | ## Plan position (IR-146 follow-ups) | Item | Owner | PR | Status | |---|---|---|---| | Flag rollback + prod billing-web deploy | FE | — | Done | | B1: no "unavailable" flash on sign-in | FE | Comfy-Org#21146 | In review | | Ingest: billing-web independent of `embedded_checked_enabled` | BE (Wei) | — | Requested | | **Remove core app embedded checkout (this PR)** | FE | **this PR** | **In review** | | QA on testcloud with the flag overridden / off | QA | — | To request | | Re-ramp `hosted_billing_destination` | FE | — | After QA | ```mermaid graph LR RB["Rollback + prod deploy"] --> B1["B1: sign-in flash (PR 21146)"] RB --> RM["Remove core embedded checkout (this PR)"] ING["Ingest: billing-web flag-independent"] --> QA["QA on testcloud"] RM --> QA B1 --> RR["Re-ramp billing_web"] QA --> RR style RM fill:#f9d71c,stroke:Comfy-Org#333,stroke-width:2px ``` Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Summary
Every cold load of billing-web's
/sign-inbriefly showed "Sign-in is unavailable right now." before the sign-in providers appeared. The notice now renders only after the identity configuration has actually failed to resolve.Why: Hunter hit the flash on production while re-testing IR-146 (billing-web upgrade flow, build
24f1250). It reads as a failure on a healthy page and is the same copy an incident would show, so it misleads users and would make a notice-based monitor fire on every visit.Root cause:
useSignInControllerexposedavailable = identity !== undefined.identityisundefinedboth while/api/featuresis still being fetched and after the fetch has failed, soSignInViewshowed the unavailable notice (and its retry) for the whole resolution window.How: the controller now reports
identityStatus: 'resolving' | 'ready' | 'unavailable'.unavailable: the notice and "Try again" render.resolving: no notice, provider buttons stay disabled.ready: unchanged.The existing 4s config-fetch timeout still ends a hung request in
unavailable, so a dead config endpoint still surfaces the notice. The twobillingWebAuth.flagOfftests that asserted the notice during the undecided first render now assert the opposite; their routing intent (reach/sign-inwithout waiting for the flag) is unchanged.Verification
pnpm exec vitest run --root apps/billing-webpasses (1516 tests). New controller test:resolvinguntil the identity resolution settles, thenunavailable. New view test: no alert and no retry while resolving, with providers disabled.pnpm typecheck:billing-webpasses./v1/checkout?product=comfyui&return_to=comfyui_workspace&plan=standard-annualin a fresh headless Chromium context, with onlyGET /api/featuresheld back 3s (network delay, the real backend still answers). AS IS = production billing.comfy.org (24f1250, cloud.comfy.org); TO BE = this PR's Vercel preview (testcloud.comfy.org). Screenshots at ~1s (config in flight) and after the providers enable.24f1250)/api/featuresin flight)"Sign-in is unavailable right now." + "Try again"
No alert, providers disabled
Plan position (IR-146 follow-ups)
hosted_billing_destinationto stripe 100%24f1250(#20319, #20532)embedded_checked_enabled)