Skip to content

fix(billing-web): no "Sign-in is unavailable" flash while sign-in is still resolving - #21146

Merged
dante01yoon merged 2 commits into
mainfrom
claude/billing-web-signin-unavailable-flash
Oct 17, 2026
Merged

dante01yoon merged 2 commits into
mainfrom
claude/billing-web-signin-unavailable-flash

Conversation

@dante01yoon

@dante01yoon dante01yoon commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Every cold load of billing-web's /sign-in briefly 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: useSignInController exposed available = identity !== undefined. identity is undefined both while /api/features is still being fetched and after the fetch has failed, so SignInView showed 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 two billingWebAuth.flagOff tests that asserted the notice during the undecided first render now assert the opposite; their routing intent (reach /sign-in without waiting for the flag) is unchanged.

Verification

  • Tests: pnpm exec vitest run --root apps/billing-web passes (1516 tests). New controller test: resolving until the identity resolution settles, then unavailable. New view test: no alert and no retry while resolving, with providers disabled. pnpm typecheck:billing-web passes.
  • Human QA: signed-out cold load of /v1/checkout?product=comfyui&return_to=comfyui_workspace&plan=standard-annual in a fresh headless Chromium context, with only GET /api/features held 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.
AS IS (prod 24f1250) TO BE (this branch)
Resolving (~1s, /api/features in flight)
as-is-resolving
"Sign-in is unavailable right now." + "Try again"
to-be-resolving
No alert, providers disabled
Settled (config resolved)
as-is-settled
to-be-settled

Plan position (IR-146 follow-ups)

Item Owner PR Status
Roll back hosted_billing_destination to stripe 100% FE — Done
Production deploy of billing-web 24f1250 (#20319, #20532) FE — Done
B1: no "unavailable" flash while sign-in resolves FE this PR In review
B2: card form on billing-web checkout (embedded_checked_enabled) FE + Hunter — Testing
B3: revert a scheduled change from the UI Product — Needs ticket
A1: production drift alert for billing-web FE — Planned
graph LR
  R["Flag rollback"] --> D["Prod deploy 24f1250"]
  D --> B1["B1: sign-in flash fix (this PR)"]
  D --> B2["B2: embedded checkout decision"]
  B1 --> RR["Re-ramp billing_web"]
  B2 --> RR
  A1["A1: prod drift alert"] --> RR
  style B1 fill:#f9d71c,stroke:#333,stroke-width:2px
Loading

…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.
@dante01yoon
dante01yoon requested a review from a team October 16, 2026 00:36
@dante01yoon dante01yoon added the billing-preview Deploy this PR's apps/billing-web changes to a Vercel preview label Oct 16, 2026
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle Size

⚠️ Size data collection failed. Check the CI workflow logs.

🔬 E2E Coverage

⚠️ Coverage collection failed. Check the CI workflow logs.

🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

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: ✅ Passed

Fallow 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 Preview

Billing Web Preview: https://comfy-billing-web-preview-pr-21146.vercel.app

This commit: https://billing-50nnsnsvm-comfyui.vercel.app

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 90303bbd-50c7-4f05-b3c8-0bb894854f4a
📥 Commits

Reviewing files that changed from the base of the PR and between b390c63 and 2944ced.

📒 Files selected for processing: 1
  • apps/billing-web/src/auth/useSignInController.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

📝 Walkthrough

The billing sign-in controller now reports identity resolution as resolving, ready, or unavailable. The sign-in view uses this status to control sign-in actions and notices. Controller, view, and session tests now check the status values.

Changes: Identity status in billing sign-in

Layer / File(s) Summary
Track identity resolution
apps/billing-web/src/auth/useSignInController.ts, apps/billing-web/src/auth/useSignInController.test.ts, apps/billing-web/src/auth/useSignInController.regression.test.ts
The controller exposes IdentityStatus and tracks pending identity loading. Tests cover the resolving, ready, and unavailable states, including retry.
Render sign-in from identity status
apps/billing-web/src/views/SignInView.vue, apps/billing-web/src/views/SignInView.test.ts, apps/billing-web/src/session/billingWebAuth.flagOff.test.ts, apps/billing-web/src/session/billingWebAuth.flagOn.test.ts
The view uses identity status to select notices and block sign-in controls. View and session tests use the status values and check the resolving state.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: christian-byrne, drjkl

Merge Risk: ⚪ Minimal · up to 2944c

The change hides the "Sign-in is unavailable" notice while sign-in is still resolving and shows it only after resolution fails. No concrete merge-blocking risk was found.

Security architecture risk: 🔵 Low · up to 2944c

The change preserves the existing identity requirement for sign-in and does not expand session authority. Remaining uncertainty concerns whether every upstream failure completes the new loading state, rather than a demonstrated authentication bypass.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated change affects sign-in presentation and readiness on billing-web across its existing session modes. The inspected delta does not add credential destinations, workspace authority, or privileged operations.

Trust Boundaries and Controls

  • observed — Pending or absent identity does not enable sign-in through the changed readiness gate. The controller also retains its identity check independently of disabled buttons, and the view retains its restricted session-only presentation after session establishment fails without a ready identity.

Resilience and Maintainability Implications

  • observed — The existing Firebase path converts fetch and initialization failures to absent identity and applies a four-second fetch timeout. Its identity cache shares in-flight resolutions and evicts unsuccessful identity results. These controls support normal resolving-to-unavailable transitions without introducing a fallback identity.
  • inferred — Transition completion remains dependent on the port: the controller clears resolving only after fulfillment and does not sequence overlapping loads. A rejecting custom port can leave resolving indefinitely. Complete upstream termination coverage for the actual mode-selection and shared-session chain was not established, so this is an uncertainty rather than a verified production regression or security bypass.
Pre-merge checks: Passed 6 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
End-To-End Test Suggestion For User-Facing Changes Warning This is a suggestion, not a merge requirement. The diff fixes a user-facing billing-web sign-in bug under apps/billing-web/src/: opening /sign-in while identity configuration is resolving showed “… Extend an existing sign-in spec under browser_tests/: - Open billing-web /sign-in while identity resolution is pending. - Expect no “Sign-in is unavailable right now.” notice. - Expect no “Try again” button. - Expect provider buttons to…
Passed Passed checks: 6 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Website End-To-End Regression Coverage Passed The pull request changes only apps/billing-web source and tests. It does not change runtime files under apps/website/src/ or apps/website/public/. The website-specific end-to-end regression check does…
Adr Compliance For Entity/Litegraph Changes Passed The changed-file list contains only billing-web authentication and sign-in view files. It contains no files under src/lib/litegraph/, src/ecs/, or graph-entity-related files. The ADR-LAYOUT and ADR-EC…
Title check Passed The title clearly and concisely describes the main change: preventing the unavailable sign-in message from appearing while sign-in is still resolving.
Description check Passed The description includes a complete summary of the problem, root cause, implementation, behavior, risks, automated test results, type-check results, and human QA evidence.
Full details: Website End-To-End Regression Coverage

Explanation

The pull request changes only apps/billing-web source and tests. It does not change runtime files under apps/website/src/ or apps/website/public/. The website-specific end-to-end regression check does not apply.

Full details: Adr Compliance For Entity/Litegraph Changes

Explanation

The changed-file list contains only billing-web authentication and sign-in view files. It contains no files under src/lib/litegraph/, src/ecs/, or graph-entity-related files. The ADR-LAYOUT and ADR-ECS checks do not apply.

Full details: End-To-End Test Suggestion For User-Facing Changes

Explanation

This is a suggestion, not a merge requirement. The diff fixes a user-facing billing-web sign-in bug under apps/billing-web/src/: opening /sign-in while identity configuration is resolving showed “Sign-in is unavailable right now.” No changed file adds or updates a spec under browser_tests/.

Resolution

Extend an existing sign-in spec under browser_tests/: - Open billing-web /sign-in while identity resolution is pending. - Expect no “Sign-in is unavailable right now.” notice. - Expect no “Try again” button. - Expect provider buttons to be disabled. - Resolve identity successfully. - Expect the provider buttons to become enabled. - Make identity resolution fail. - Expect the unavailable notice to appear.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

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     
Flag Coverage Δ
billing-web-unit 92.38% <100.00%> (+0.01%) ⬆️
website-unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
apps/billing-web/src/auth/useSignInController.ts 82.25% <100.00%> (+1.22%) ⬆️
apps/billing-web/src/views/SignInView.vue 93.84% <100.00%> (+0.09%) ⬆️

... and 970 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the risk:xhigh PR risk grade (advisory shadow check; grader-owned) label Oct 16, 2026

@christian-byrne christian-byrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@datadog-official

datadog-official Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Pipelines

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 6 Pipeline jobs failed

CI: Billing Web E2E | billing-web-e2e-gate

View in Datadog · View in GitHub Actions

CI: Billing Web Unit | billing-web-unit-gate

View in Datadog · View in GitHub Actions

CI: Tests E2E | e2e-status

View in Datadog · View in GitHub Actions

View all 6 failed jobs.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2944ced | Docs | View more details | Give us feedback!

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 16, 2026
@dante01yoon

Copy link
Copy Markdown
Collaborator Author

Dropped the export on IdentityStatus in 2944ced — it's only used inside useSignInController.ts. billing-web auth + view tests pass (423).

@christian-byrne christian-byrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Penguinjanator pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Oct 17, 2026
…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>
@dante01yoon
dante01yoon added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit 6bbe3db Oct 17, 2026
117 of 169 checks passed
@dante01yoon
dante01yoon deleted the claude/billing-web-signin-unavailable-flash branch October 17, 2026 03:41

This branch was previously deployed

1 inactive deployment
website-approval — 2944cedf Deployed Oct 16, 2026 by dante01yoon via fast-lane #5553
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

billing-preview Deploy this PR's apps/billing-web changes to a Vercel preview risk:xhigh PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants